wang xuancong added the comment:
Another lazy explanation not wanting to improve anything
--
___
Python tracker
<https://bugs.python.org/issue44930>
___
___
New submission from wang xuancong :
Different from Python 2, Python 3 has removed the capability to create a list
from a range. In Python 2, we can use range(1,100,2) to create a list [1, 3, 5,
..., 99], but in Python 3, we can only use list(range(1,100,2)) or
[*range(1,100,2)] where
wang xuancong added the comment:
Thanks @terry.reedy for your expert-level good comments!
1.
"In Python 3, the one *implementation*, and its lookup mode, are fixed. The
slower implementation was dropped because it was not thought worth the bother."
If I remember correctly, the p
wang xuancong added the comment:
Of course, I am aware of that. As elite-level Python programmers, we should all
be aware of security issues whenever we deal with exec() and eval().
--
___
Python tracker
<https://bugs.python.org/issue44
New submission from wang xuancong :
In general, the ability to update local variables is very important and it
simplifies life tremendously. For example, in machine learning, it allows
saving/loading arbitrary-format datasets and arbitrary-structure neural
networks (NN) using a single line
New submission from wang xuancong :
If I load a file which contains "\r" and "\n", I can find "\n", but not "\r".
This behaviour is inconsistent in Python 3, but consistent in Python 2.
>>> open('./3cjkxdnw/accessibilityLog/1570181896323
wang xuancong added the comment:
I agree with Mark Amery.
The reason why defaultdict still exists given that everything can be achieved
by subclassing the built-in dict is because of convenience. I suggest maybe
Python developer can put it into low priority instead.
--
nosy
New submission from wang xuancong :
A very common use of defaultdict is that if the key exist, use the
corresponding mapped target, if the key does not exist, use the key itself.
However, current Python 2/3 defaultdict does not support parametric lambda
function:
>>> from collectio
New submission from wang xuancong :
We all know that since:
[False, True, False].count(True) gives 1
eval('[False, True, False].count(True)') also gives 1.
However, in Python 2,
eval('[False, True, False].count(True)', {}, Counter()) gives 3, while
eval('[False, True, False].count(True
New submission from wang xuancong :
Python3 programmers have forgotten to convert/implement the socket file
descriptor for IO stream operation. Would you please add it? Thanks!
import socket
s = socket.socket()
s.connect('localhost', 5432)
S = s.makefile()
# on Python2, the following works
New submission from wang xuancong:
Hi python developers,
I notice that one major change in python 3 is that you make 'print' as a
standard function, and it will require typing (). As you know, reading from and
writing to IO is a high frequency operation. By entropy coding theorem, you
should
11 matches
Mail list logo