wouter bolsterlee added the comment:
pull request with fix at https://github.com/python/cpython/pull/27946
--
keywords: +patch
message_count: 1.0 -> 2.0
pull_requests: +26392
stage: -> patch review
pull_request: https://github.com/python/cpython/pull
New submission from wouter bolsterlee :
Various date parsing utilities in the email module, such as
email.utils.parsedate(), are supposed to gracefully handle invalid input,
typically by raising an appropriate exception or by returning None.
The internal email._parseaddr._parsedate_tz
wouter bolsterlee added the comment:
the test could be sth like
x = uuid.uuid4()
y = weakref.ref(x)
assert x is y()
--
___
Python tracker
<https://bugs.python.org/issue35
Changes by wouter bolsterlee :
--
resolution: -> rejected
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
wouter bolsterlee added the comment:
i consider uuids as low level data types, not as fancy containers, similar to
how i view datetime objects. given the native support in e.g. postgresql and
many other systems, it's common to deal with uuids.
of course you can convert to/from strin
Wouter Bolsterlee added the comment:
as a follow-up note, i also experimented with keeping the actual value as a
bytes object instead of an integer, but that does not lead to less memory being
used: a 128-bit integer uses less memory than a 16 byte bytes object
(presumably because
New submission from Wouter Bolsterlee:
memory usage for uuid.UUID seems larger than it has to be. it seems that using
__slots__ will save around ~100 bytes per instance, which is very significant,
e.g. when dealing with large sets of uuids (which are often used as "primary
keys" int
Changes by Wouter Bolsterlee :
--
pull_requests: +2835
___
Python tracker
<http://bugs.python.org/issue30977>
___
___
Python-bugs-list mailing list
Unsubscribe:
Wouter Bolsterlee added the comment:
fwiw, "if (PyDict_CheckExact(a) && a == b)" amounts to two pointer comparisons,
the overhead of which is too small to measure. (i tried.)
--
___
Python tracker
<http://bugs.
Changes by Wouter Bolsterlee :
--
pull_requests: +2745
___
Python tracker
<http://bugs.python.org/issue30907>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Wouter Bolsterlee:
when comparing instances of the built-in container types (dict, list, and
others) python assumes that "identity implies equality". this is documented
(and assumed) behaviour:
"In enforcing reflexivity of elements, the comparison of coll
Wouter Bolsterlee added the comment:
Using IPython and CPython 3.4:
>>> d = dict.fromkeys(map(str, range(1000)))
Current implementation:
>>> %timeit sorted(d.items(), key=lambda kv: kv[0])
1000 loops, best of 3: 605 µs per loop
>>> %timeit sorted(d.items(), key=l
New submission from Wouter Bolsterlee:
The JSON encoder uses a lambda function for the sort(key=...) invocation used
to sort the keys in a JSON object in case sort_keys=True is passed:
https://hg.python.org/cpython/file/46bfddb14cbe/Lib/json/encoder.py#l352
Instead of having a lambda
Wouter Bolsterlee added the comment:
(In case you missed it: my latest comment included a cleaned up version of an
earlier patch.)
--
___
Python tracker
<http://bugs.python.org/issue18
Wouter Bolsterlee added the comment:
Thanks for the quick response.
Btw, do I understand correctly code cleanups are not welcome, even when
touching the code anyway?
--
___
Python tracker
<http://bugs.python.org/issue18
Wouter Bolsterlee added the comment:
Thanks Raymond, that is exactly what I had in mind (see my previous comment).
Here's a slightly cleaned up version of the patch (stylistic/PEP8 cleanups),
with some benchmarks included below.
In case the two longest iterators have about the same siz
Wouter Bolsterlee added the comment:
An additional speedup would be to add a "if len(h) == 1" check inside the while
loop, and just yield from the remaining iterator if a single iterable remains.
This would also speed up merges with multiple inputs, as it doesn't do the
wh
New submission from Wouter Bolsterlee:
The heapq.merge() function merges multiple sorted iterables into a single
sorted output. The function uses a heap queue that is repeatedly looped over
until it has generated all output.
If only a single iterable is passed to heapq.merge(), the heap will
18 matches
Mail list logo