4 ms·
Well honestly, python 2* is a lot more convenient to write in a lot of ways, and the benefits of 3 aren't big enough to make up for it for a lot of people/use c
by jimmaswell 13y ago
Well honestly, python 2* is a lot more convenient to write in a lot of ways, and the benefits of 3 aren't big enough to make up for it for a lot of people/use cases.
- dragonwriter 13y ago> Well honestly, python 2* is a lot more convenient to write in a lot of ways In what way is python 2 more convenient to write? Outside of the rapidly shrinking set of cases where the best approach to a key problem is addressed by a Py 2 only library -- or the case of "I want to deploy on Google App Engine" -- I don't really see how Py 2 is "more convenient".
- andy 13y agoprint x doesn't work, you have to use print(x).
- tonyarkles 13y agoOn both OSX and many Linux distros, Py 2 comes pre-installed but Py 3 does not. If I'm going to write simple scripts that I'm going to give out to people, it's nice not having to worry about them needing to fuck around to get the script to run.
- djjaxe 13y ago> On both OSX and many Linux distros, Py 2 comes pre-installed but Py 3 does not. Because python 3 was not the most stable at the time of distribution of that operating system. Why would I the developer of said operating system release anything but the most stable versions of the language? This would in turn make my operating system at times less stable.
- tonyarkles 13y agoI totally agree. However, until Py3 is packaged standard it's always going to be easier to run Py2 code. For example, I have a friend who does data analysis on OSX and occasionally she gets data in a format that is ugly. I take a look at it and send her a python script that will massage it into something nice. She's ok with the occasional "sudo pip install ..." to get a library, but if my instructions started with "ok, first install Xcode and then install homebrew" the answer would probably be "it's ok I'll just do it by hand"
- takeda 13y agoIt already is in many distros.
- collyw 13y agoSimple script like that are unlikely to be much different between Python 2 and 3 unless you are using specific libraries. Just make make all the "prints" into "prints()" and "Exeption, e" into "Exception as e", and I can't see what the differences would be.
- tonyarkles 13y agoThe difference is in the effort required to make it run at all!
- collyw 13y agosudo apt-get install python3. Or Whatever the OSX equivalent is. Its not that difficult. Arch comes with Python 3 as default.
- TheCoelacanth 13y agoOSX doesn't come with a package manager.
- deleted 13y ago[deleted]
- viraptor 13y agoBoth ways of formatting are available. % is not going away.
- jimmaswell 13y agocan't use print x anymore, which also gets rid of "print x,", which printed something without making a newline, for one thing.
- SoftwareMaven 13y agoprint(x, end='') Not quite as nice, but not exactly unusable. https://docs.python.org/3.1/library/functions.html#print https://docs.python.org/3.1/library/functions.html#print
- jimmaswell 13y agoIt's a lot less "pythonic".
- tim333 13y agoDunno. The 3 way is more "Explicit is better than implicit." Though it's a shame Python 3 messes up http://xkcd.com/353/ http://xkcd.com/353/
- tim333 13y agoDunno. The 3 way is more "Explicit is better than implicit." Though it's a shame Python 3 messes up http://xkcd.com/353/ http://xkcd.com/353/
- dragonwriter 13y ago> can't use print x anymore Yes, its a function not a statement, so its now print(x). > which also gets rid of "print x,", which printed something without making a newline, for one thing. Sure, you have to do: print(x,end=' ') if you want to space separate things printed on separate code lines on the same output line. Of course, if the extra keystrokes bother you, its really not much one-time cost to toss together a library that provides a function that gets rid of them, while keeping the rest of the power of the print function: def p(*args, **kwargs): kwargs = {'end': ' '}.update(kwargs) print(*args,**kwargs) Though if I was going to bother to do that, I'd probably do it with the same separator for multiple items on the same line as for items on different lines: def p(*args, **kwargs): kwargs = {'sep': ' ', 'end': ' '}.update(kwargs) print(*args,**kwargs) or, further leveraging print-is-a-function: import functools p = functools.partial(print, sep=' ',end=' ')