Serhiy Storchaka added the comment:
Where does dataclasses call mro()?
--
___
Python tracker
<https://bugs.python.org/issue45531>
___
___
Python-bugs-list mailin
Serhiy Storchaka added the comment:
Is not it a duplicate of issue15996?
--
___
Python tracker
<https://bugs.python.org/issue44970>
___
___
Python-bugs-list m
Serhiy Storchaka added the comment:
There may be a simple error (superfluous .__class__), but I am not sure.
BTW, why use mro() instead of __mro__? Most code use __mro__.
--
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
random.getrandbits() is cryptographically weaker than os.urandom().
--
nosy: +rhettinger, serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
Agree with Tim.
The idea of optimizing stack manipulation operations for constants is
interesting, but is it common enough case to justify the compiler complication?
See also rejected issue27236.
--
nosy: +serhiy.storchaka
Serhiy Storchaka added the comment:
This code was added in bpo-10978. Raymond, what are your thoughts?
--
nosy: +rhettinger
versions: +Python 3.11 -Python 3.9
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
Sure.
--
resolution: -> out of date
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
And with optimization of math.perm() for small arguments:
$ ./python -m pyperf timeit -s 'from math import perm' 'perm(30, 14)'
Mean +- std dev: 524 ns +- 43 ns -> 66.7 ns +- 4.6 ns: 7.85x faster
$ ./python -m pyperf timeit -s 'from math import perm' 'p
Change by Serhiy Storchaka :
--
pull_requests: +27366
pull_request: https://github.com/python/cpython/pull/28986
___
Python tracker
<https://bugs.python.org/issue45
Change by Serhiy Storchaka :
--
pull_requests: +27365
pull_request: https://github.com/python/cpython/pull/29003
___
Python tracker
<https://bugs.python.org/issue45
Change by Serhiy Storchaka :
--
pull_requests: +27356
pull_request: https://github.com/python/cpython/pull/29090
___
Python tracker
<https://bugs.python.org/issue37
Serhiy Storchaka added the comment:
Divide-and-conquer approach works pretty well for larger n.
For results slightly out of the 64-bit range:
$ ./python -m pyperf timeit -s 'from math import comb' 'comb(63, 31)'
Mean +- std dev: 2.80 us +- 0.14 us -> 388 ns +- 19 ns: 7.22x faster
$ ./pyt
New submission from Serhiy Storchaka :
For example:
>>> from enum import *
>>> class E(IntEnum):
... x = 1
...
>>> dir(E)
['__class__', '__doc__', '__members__', '__module__', 'x']
>>> E.from_bytes
>>> E.to_bytes
>>> E.numer
Serhiy Storchaka added the comment:
In Enum it is just implicitly forbidden:
>>> from enum import *
>>> class A(Enum):
... mro = 1
... x = 2
...
Traceback (most recent call last):
File "", line 1, in
File "/home/serhiy/py/cpython/Lib/enum.py
Serhiy Storchaka added the comment:
That would be an unfair advantage. If we want people to use the limited API we
should not make it much slower than the non-limited API.
--
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
I do not like requirement to allocate Py_buffer on the heap. It adds an
overhead. Common case in CPython code is:
Py_buffer view;
void *buf;
Py_ssize_t len;
PyObject_GetBuffer(obj, , PyBUF_SIMPLE);
buf = view.buf;
len = view.len;
// no other fields
Serhiy Storchaka added the comment:
Thanks Łukasz and Dong-hee Na.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +27336
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29002
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
Possible solutions (they can be combined):
1. Add support for the GEORGIAN-PS charset and all other encodings used in libc
(issue22679). The problem is that it is difficult to get the official
information about these encodings.
2. Falls back to utf-8
Serhiy Storchaka added the comment:
Py_buffer is often used for handling arguments if the function supports bytes,
bytearray and other bytes-like objects. For example bytes.partition(). Any
additional memory allocation would add significant overhead here. bytes.join()
creates Py_buffer
Serhiy Storchaka added the comment:
Microbenchmarks:
$ ./python -m pyperf timeit -s 'from math import comb' '[comb(n, k) for n in
range(63) for k in range(n+1)]'
Mean +- std dev: 1.57 ms +- 0.07 ms -> 209 us +- 11 us: 7.53x faster
$ ./python -m pyperf timeit -s 'from math import comb' 'c
Serhiy Storchaka added the comment:
The main concern is that it is not clear how to use this feature, and if it is
not clear, it will not be used. I am not even sure that it is Pythonic, because
I do not know how to use it. For example, can it be used to implement
transactions? How it works
Serhiy Storchaka added the comment:
Here is more optimized PR inspired by PR 29020. It would be too long to explain
how PR 29020 can be improved, so I write a new PR.
Basically it implements Raymond's idea #1, but supports n>62 for smaller k.
How to calculate limits:
import math
n = m
Change by Serhiy Storchaka :
--
pull_requests: +27302
pull_request: https://github.com/python/cpython/pull/29030
___
Python tracker
<https://bugs.python.org/issue37
Change by Serhiy Storchaka :
--
pull_requests: +27294
pull_request: https://github.com/python/cpython/pull/29021
___
Python tracker
<https://bugs.python.org/issue42
Serhiy Storchaka added the comment:
New changeset b3f0ceae919c1627094ff628c87184684a5cedd6 by Serhiy Storchaka in
branch 'main':
bpo-45229: Make test_http_cookiejar discoverable (GH-29004)
https://github.com/python/cpython/commit/b3f0ceae919c1627094ff628c87184684a5cedd6
Change by Serhiy Storchaka :
--
pull_requests: +27286
pull_request: https://github.com/python/cpython/pull/29004
___
Python tracker
<https://bugs.python.org/issue45
Change by Serhiy Storchaka :
--
dependencies: +Rewrite test_dbm
___
Python tracker
<https://bugs.python.org/issue45229>
___
___
Python-bugs-list mailin
Change by Serhiy Storchaka :
--
dependencies: +Fix test_shelve and make it discoverable
___
Python tracker
<https://bugs.python.org/issue45229>
___
___
Python-bug
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +27285
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29003
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
Also it was only tested with pickle protocols 0, 1 and 2. Now it will be tested
with all pickle protocols.
--
___
Python tracker
<https://bugs.python.org/issue45
New submission from Serhiy Storchaka :
test_shelve was intended to run some tests for all underlying dbm
implementation, but since b17acad68ea21c60dbc2088644f2934032304628 (at May
2008) it runs them with the same implementation.
The proposed PR fixes this regression and also makes
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +27284
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29002
___
Python tracker
<https://bugs.python.org/issu
New submission from Serhiy Storchaka :
* Generate test classes at import time. It allows to filter them when run with
unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v".
* Create a database class in a new directory which will be removed after test.
It guarantee
Serhiy Storchaka added the comment:
I think it would help if we could enable some future feature globally by
command line option or environment variable, without modifying all source
files. It would allow users to quickly test their code base for compatibility
with future changes
Serhiy Storchaka added the comment:
Pure cosmetic changes are usually rejected.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
And on what of them it is failed?
--
___
Python tracker
<https://bugs.python.org/issue45496>
___
___
Python-bugs-list mailin
Change by Serhiy Storchaka :
--
pull_requests: +27272
pull_request: https://github.com/python/cpython/pull/28986
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
See PR 6578. We already faced a similar problem when test_winfo_rgb was added.
We finally found test colors which behave consistently on all tested platforms.
But it turns out that not on all.
--
___
Python
Serhiy Storchaka added the comment:
Thank you Inada-san. My first intention when I seen this code was to simplify
it, but then I have found that it was an intentional change.
It may be easy to detect such code and raise a syntax warning or error. Or get
rid of this limitation and allow
Change by Serhiy Storchaka :
--
components: +Interpreter Core
stage: -> needs patch
title: Deprecate delegation of int to __trunc__? -> Deprecate delegation of int
to __trunc__
versions: +Python 3.11
___
Python tracker
<https://bugs.p
Serhiy Storchaka added the comment:
Thank you for your contribution Graham.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
What are issues with using global variable as import target?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue32
Serhiy Storchaka added the comment:
New changeset 59a633d3e2071d65aa6638da5cf767a5c1310271 by Graham Inggs in
branch 'main':
bpo-45428: Fix reading filenames from stdin in py_compile (GH-28848)
https://github.com/python/cpython/commit/59a633d3e2071d65aa6638da5cf767a5c1310271
Serhiy Storchaka added the comment:
For reference, caching was introduced in
b1aa19515ffdb84c6633ee0344196fd8bd50ade0 21 years ago, and initially it checked
for pre-compiled patterns before looking up in the cache. But it was changed 2
months later
Serhiy Storchaka added the comment:
And compare it with pat.match("asdf").
If the performance is critical, use methods of pre-compiled patterns.
--
___
Python tracker
<https://bugs.python.o
Change by Serhiy Storchaka :
--
resolution: -> out of date
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +27244
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28955
___
Python tracker
<https://bugs.python.org/issu
New submission from Serhiy Storchaka :
The proposed PR adds C API functions PyUnicode_DecodeUnicodeEscapeStateful()
and PyUnicode_DecodeRawUnicodeEscapeStateful() for partially decoding with
"unicode-escape" and "raw-unicode-escape" encodings. It were the only multibyte
t
Serhiy Storchaka added the comment:
New changeset 684860280687561f6312e206c4ccfbe4baa17e89 by Serhiy Storchaka in
branch '3.9':
bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape"
codec (GH-28944) (GH-28953)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
New changeset 4641afef661e6a22bc64194bd334b161c95edfe2 by Serhiy Storchaka in
branch '3.10':
[3.10] bpo-45467: Fix IncrementalDecoder and StreamReader in the
"raw-unicode-escape" codec (GH-28944) (GH-28952)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
Calling re.math() with a pre-compiled pattern is an uncommon case. Common cases
are calling re.math() with a string pattern and calling the math() method of a
pre-compiled pattern.
Your change speeds up an uncommon case but slows down a common case
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
Examples of using the new feature.
--
___
Python tracker
<https://bugs.python.org/issue45452>
___
___
Python-bugs-list mailin
Change by Serhiy Storchaka :
--
pull_requests: +27241
pull_request: https://github.com/python/cpython/pull/28953
___
Python tracker
<https://bugs.python.org/issue45
Change by Serhiy Storchaka :
--
pull_requests: +27240
pull_request: https://github.com/python/cpython/pull/28952
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
New changeset 39aa98346d5dd8ac591a7cafb467af21c53f1e5d by Serhiy Storchaka in
branch 'main':
bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape"
codec (GH-28944)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
New changeset 7c722e32bf582108680f49983cf01eaed710ddb9 by Serhiy Storchaka in
branch '3.9':
[3.9] bpo-45461: Fix IncrementalDecoder and StreamReader in the
"unicode-escape" codec (GH-28939) (GH-28945)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
New changeset 0bff4ccbfd3297b0adf690655d3e9ddb0033bc69 by Miss Islington (bot)
in branch '3.10':
[3.10] bpo-45461: Fix IncrementalDecoder and StreamReader in the
"unicode-escape" codec (GH-28939) (GH-28943)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
Please show examples.
--
___
Python tracker
<https://bugs.python.org/issue45452>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
I am interesting how these gdbm_failure_atomic() and gdbm_latest_snapshot() can
be used in user code. Some real world examples. They look very low-level and
requiring an additional boilerplate code to be useful if I understand it
correctly
Serhiy Storchaka added the comment:
And what's next?
--
___
Python tracker
<https://bugs.python.org/issue45452>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
How would it be used from Python? What are scenarios?
--
___
Python tracker
<https://bugs.python.org/issue45452>
___
___
Change by Serhiy Storchaka :
--
pull_requests: +27233
pull_request: https://github.com/python/cpython/pull/28945
___
Python tracker
<https://bugs.python.org/issue45
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +27232
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28944
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
dependencies: +UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c
in position 8191: \ at end of string
___
Python tracker
<https://bugs.python.org/issue45
New submission from Serhiy Storchaka :
Similar to 45461, but with "raw-unicode-escape".
When an incremental decoder gets a part of escape sequence (\u or
\U) it raises an exception or return a bare "\" if it was the only part
instead of keeping it un
Serhiy Storchaka added the comment:
New changeset c96d1546b11b4c282a7e21737cb1f5d16349656d by Serhiy Storchaka in
branch 'main':
bpo-45461: Fix IncrementalDecoder and StreamReader in the "unicode-escape"
codec (GH-28939)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +27228
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28939
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
assignee: -> serhiy.storchaka
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
ndim is not known before calling PyObject_GetBuffer(), so we will need a new
API which combines PyObject_GetBuffer() and PyBuffer_New().
--
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
The cause is that isinstance(list[int], type) returns True. It can cause bugs
in other parts of the code which test for instance of type. For example:
>>> types.resolve_bases((typing.List[int],))
(, )
>>> types.resolve_bases((list
Serhiy Storchaka added the comment:
I agree with Mark. Instead of exposing internal details in low-level API we
should add more high-level API to satisfy concrete needs. It will give us more
freedom of changing internals in future.
--
nosy: +serhiy.storchaka
Serhiy Storchaka added the comment:
shape is a pointer to array of Py_ssize_t of size ndim. array and memoryview do
a trick to avoid memory allocation, but _testbuffer.ndarray allocates it
dynamically in the heap. We can add a small static buffer in Py_buffer to avoid
additional memory
Serhiy Storchaka added the comment:
It works as expected:
>>> re.sub(r'\W', '', '½ a', 0, re.ASCII)
'a'
You just passed re.ASCII as the count argument, not as the flags argument.
>>> help(re.sub)
Help on function sub in module re:
sub(pattern, repl, string, count=0, f
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue45438>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
See also issue22035.
--
___
Python tracker
<https://bugs.python.org/issue45452>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
BTW, I think that we spent on issue36521 much more time (especially your time,
Inada-san) than it deserved. In normal case 3~5% would look not impressive. But
I do not see any immediate drawbacks of making this change, and I afraid that
if we do not make
Serhiy Storchaka added the comment:
The behavior difference can be eliminated if make func_set_code() calling
func_get_doc().
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue45
Change by Serhiy Storchaka :
--
resolution: -> not a bug
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue45456>
___
___
Pyth
Change by Serhiy Storchaka :
--
nosy: -180909
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.9
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
sort() is atomic, even if GIL is released during executing custom __lt__. It is
guaranteed that no operations on the list in other threads can affect the
result of sort().
I do not understand what non-atomic you see in x = L[i]. The value of x
New submission from Serhiy Storchaka :
New changeset b37dc9b3bc9575adc039c6093c643b7ae5e917e1 by 180909 in branch
'main':
bpo-45441: Update some moved URLs in documentation (GH-28861)
https://github.com/python/cpython/commit/b37dc9b3bc9575adc039c6093c643b7ae5e917e1
--
nosy
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
type: -> enhancement
versions: +Python 3.10, Python 3.11
___
Python tracker
<https://bugs.python
Serhiy Storchaka added the comment:
New changeset 47a50fe16f9f074d3e6aa85e76502955ed40 by Miss Islington (bot)
in branch '3.10':
bpo-45401: Fix a resource warning in test_logging (GH-28864) (GH-28872)
https://github.com/python/cpython/commit/47a50fe16f9f074d3e6aa85e76502955ed40
Serhiy Storchaka added the comment:
New changeset faa87f7f3b60f79b9018aaef0efa5e00d82b817b by Miss Islington (bot)
in branch '3.9':
bpo-45401: Fix a resource warning in test_logging (GH-28864) (GH-28873)
https://github.com/python/cpython/commit/faa87f7f3b60f79b9018aaef0efa5e00d82b817b
Serhiy Storchaka added the comment:
New changeset 23528905d48ddfe74a75af2152e96c04b77bf314 by Miss Islington (bot)
in branch '3.9':
bpo-42253: Update xml.dom.minidom.rst (GH-23126) (GH-28875)
https://github.com/python/cpython/commit/23528905d48ddfe74a75af2152e96c04b77bf314
Serhiy Storchaka added the comment:
New changeset 3d7009e88e0ae516b10d8d3d402cc66e86fb631e by Miss Islington (bot)
in branch '3.10':
bpo-42253: Update xml.dom.minidom.rst (GH-23126) (GH-28874)
https://github.com/python/cpython/commit/3d7009e88e0ae516b10d8d3d402cc66e86fb631e
Serhiy Storchaka added the comment:
New changeset c7e81fcf9548ab6a0a4828d6f2db9ece9d204826 by Jens Diemer in branch
'main':
bpo-42253: Update xml.dom.minidom.rst (GH-23126)
https://github.com/python/cpython/commit/c7e81fcf9548ab6a0a4828d6f2db9ece9d204826
--
nosy: +serhiy.storchaka
Serhiy Storchaka added the comment:
New changeset 15188b115a2da815556053372c912a81a74be43b by Serhiy Storchaka in
branch 'main':
bpo-45401: Fix a resource warning in test_logging (GH-28864)
https://github.com/python/cpython/commit/15188b115a2da815556053372c912a81a74be43b
Change by Serhiy Storchaka :
--
pull_requests: +27165
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/28864
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
With tracemalloc enabled:
$ ./python -X tracemalloc -m test -v test_logging -m test_should_not_rollover
...
test_should_not_rollover (test.test_logging.TimedRotatingFileHandlerTest) ...
/home/serhiy/py/cpython/Lib/unittest/case.py:547: ResourceWarning
Serhiy Storchaka added the comment:
test_should_not_rollover (test.test_logging.TimedRotatingFileHandlerTest) ...
/home/serhiy/py/cpython/Lib/unittest/case.py:547: ResourceWarning: unclosed
file <_io.TextIOWrapper name='/dev/null' mode='a' encoding='utf-8'>
if method() is no
Change by Serhiy Storchaka :
--
status: closed -> open
___
Python tracker
<https://bugs.python.org/issue45401>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue45356>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
types.UnionType corresponds to typing._UnionGenericAlias, not typing.Union.
We can make (int | str | T)[dict] returning an instance of types.UnionType
instead of an instance of typing._UnionGenericAlias. But it will be a breaking
change, because typing
Serhiy Storchaka added the comment:
Seems it introduced a resource warning in tests.
--
___
Python tracker
<https://bugs.python.org/issue45401>
___
___
Pytho
Serhiy Storchaka added the comment:
New changeset 1a7892414e654aa5c99efa31db767baba7f4a424 by Joongi Kim in branch
'main':
bpo-45416: Fix use of asyncio.Condition() with explicit Lock objects (GH-28850)
https://github.com/python/cpython/commit/1a7892414e654aa5c99efa31db767baba7f4a424
601 - 700 of 25750 matches
Mail list logo