Python 3.5.0
41–50 of 165 posts
Re: Python 3.5.0
#42Re: Python 3.5.0
#43I've recently joined a Python project, my first time working with the language. We're currently using Python 2.7. How do experienced Pythonistas decide if/when to upgrade to 3.x? I figured it was a no brainer given that it has been 7 years with a number of big releases, but Flask's warning on this topic put me off: http://flask.pocoo.org/docs/0.10/python3/
Sadly the situation for using asyncio for web was not that great last I checked, because that would be a strong incentive.
Re: Python 3.5.0
#44PEP 0448 in addition to already implemented PEP 3132 make it very tempting to switch. If PEP 0448 had unpacking in comprehensions I'd switch. (Doesn't seem be a follow-up PEP just for that functionality yet.) https://www.python.org/dev/peps/pep-0448/ https://www.python.org/dev/peps/pep-3132/ I'd be really nice to use this. >>> [*range(i) for i in range(5)] Instead of this monstrosity right now. >>> [x for y in (range…
That really bugged me for a while, but then I added a "snippet" into my editor. Now I type: pr then the tab-key, and it transforms to:
print('', ) # with cursor between quotes
and it works well, also I have similar shortcuts for logging.Re: Python 3.5.0
#45I've recently joined a Python project, my first time working with the language. We're currently using Python 2.7. How do experienced Pythonistas decide if/when to upgrade to 3.x? I figured it was a no brainer given that it has been 7 years with a number of big releases, but Flask's warning on this topic put me off: http://flask.pocoo.org/docs/0.10/python3/
Re: Python 3.5.0
#46Re: Python 3.5.0
#47PEP 0448 in addition to already implemented PEP 3132 make it very tempting to switch. If PEP 0448 had unpacking in comprehensions I'd switch. (Doesn't seem be a follow-up PEP just for that functionality yet.) https://www.python.org/dev/peps/pep-0448/ https://www.python.org/dev/peps/pep-3132/ I'd be really nice to use this. >>> [*range(i) for i in range(5)] Instead of this monstrosity right now. >>> [x for y in (range…
> Such as filter keeping the type. In 3 it returns an iterator. > >>> filter(lambda x: x in 'ABC', 'ABCDEFA') > 'ABCA' it was a special case for a few types, didn't (couldn't) work for all types e.g. >>> filter(lambda x: x in 'ABC', set('ABC')) ['A', 'C', 'B'] > Also, I like print. I like Python 3's print. It's kind-of a pain because my day-to-day uses Python 2 and the context switch is annoying, but 3's is way more…
>>> from __future__ import print_function
>>> print("hi")
hi
>>>
My team is starting to use it as we look to migrate various command line utilities to python 3.Re: Python 3.5.0
#48Earlier quoted context omitted.
Agreed but does this apply in Numpy as well? Will Python matrix multiplications just work on lists of lists in which case they're much slower? Sorry just asking from a 2.7 holdout here as this might cause me to move.
From: http://legacy.python.org/dev/peps/pep-0465/#id24 Implementing __matmul__, __rmatmul__ and __imatmul__ will allow you to apply this operator to any given class. In that light, you could subclass the numpy matrix class yourself and simply apply these. As for whether these will be applied to Python lists, my speculation is: I doubt it. Its possibly the most commonly used data structure, and I doubt they would add…
Unless I'm grossly mistaken, Python methods add basically no per-instance overhead (they add per-class overhead.)
Re: Python 3.5.0
#49Question - is there any web/api framework that leverages asyncio ? This implicitly also means first class DB/ORM support. Flask, sqlalchemy ,etc seem to be using gevent and py 2.7.
https://github.com/klen/py-frameworks-bench/blob/develop/fra...
Re: Python 3.5.0
#50The scandir update also changes the underlying implementation of os.walk giving loads of production apps a huge speed increase by making use of additional data returned by the os calls.
(I understand that adding os.scandir might require a PEP)