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/p
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 until get
Change by Serhiy Storchaka :
--
dependencies: +UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c
in position 8191: \ at end of string
___
Python tracker
<https://bugs.pyt
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 :
--
pull_requests: +27233
pull_request: https://github.com/python/cpython/pull/28945
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
How would it be used from Python? What are scenarios?
--
___
Python tracker
<https://bugs.python.org/issue45452>
___
___
Serhiy Storchaka added the comment:
And what's next?
--
___
Python tracker
<https://bugs.python.org/issue45452>
___
___
Python-bugs-list mailing list
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:
Please show examples.
--
___
Python tracker
<https://bugs.python.org/issue45452>
___
___
Python-bugs-list mailing list
Unsub
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/p
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/p
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/p
Change by Serhiy Storchaka :
--
pull_requests: +27240
pull_request: https://github.com/python/cpython/pull/28952
___
Python tracker
<https://bugs.python.org/issue45
Change by Serhiy Storchaka :
--
pull_requests: +27241
pull_request: https://github.com/python/cpython/pull/28953
___
Python tracker
<https://bugs.python.org/issue45
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 :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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/p
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/p
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
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
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
resolution: -> out of date
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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 in
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/59a633d3e2071d65aa6638da5cf767
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:
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
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 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
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
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:
And on what of them it is failed?
--
___
Python tracker
<https://bugs.python.org/issue45496>
___
___
Python-bugs-list mailin
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:
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. The
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
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 :
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
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
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
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 :
--
dependencies: +Rewrite test_dbm
___
Python tracker
<https://bugs.python.org/issue45229>
___
___
Python-bugs-list mailin
Change by Serhiy Storchaka :
--
pull_requests: +27286
pull_request: https://github.com/python/cpython/pull/29004
___
Python tracker
<https://bugs.python.org/issue45
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/b3f0ceae919c1627094ff628c87184
Change by Serhiy Storchaka :
--
pull_requests: +27294
pull_request: https://github.com/python/cpython/pull/29021
___
Python tracker
<https://bugs.python.org/issue42
Change by Serhiy Storchaka :
--
pull_requests: +27302
pull_request: https://github.com/python/cpython/pull/29030
___
Python tracker
<https://bugs.python.org/issue37
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
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:
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 '
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 for
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 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:
Thanks Ćukasz and Dong-hee Na.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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, &view, PyBUF_SIMPLE);
buf = view.buf;
len = view.len;
// no other fi
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:
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
New submission from Serhiy Storchaka :
For example:
>>> from enum import *
>>> class E(IntEnum):
... x = 1
...
>>> dir(E)
['__class__', '__doc__', '__members__', '__module__', 'x']
>>> E.from_by
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
Change by Serhiy Storchaka :
--
pull_requests: +27356
pull_request: https://github.com/python/cpython/pull/29090
___
Python tracker
<https://bugs.python.org/issue37
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: +27366
pull_request: https://github.com/python/cpython/pull/28986
___
Python tracker
<https://bugs.python.org/issue45
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 '
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:
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:
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:
random.getrandbits() is cryptographically weaker than os.urandom().
--
nosy: +rhettinger, serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue45
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:
Is not it a duplicate of issue15996?
--
___
Python tracker
<https://bugs.python.org/issue44970>
___
___
Python-bugs-list m
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:
Would not be more correct to look at cls.__dict__[fieldname]?
BTW, mro() cannot be builtin, because you should be able to override it in some
classes.
--
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
It is expected behavior. Your code is equivalent to:
_result = []
for i in your_list:
_result.append(your_list.append(i))
which is equivalent to:
_result = []
_j = 0
while _j < len(your_list):
i = your_list[_j]
_result.append(your_list.app
Serhiy Storchaka added the comment:
The simple implementation is:
def cached_method(func):
return cached_property(lambda self: lru_cache()(partial(func, self)))
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
There are two ways to fix the larger issue.
1. Make issubclass(types.GenericAlias, type) returning True, and also make
isinstance(typing.List[int], type) returning True and
issubclass(typing._GenericAlias, type) returning True, and analyze every place
in
Serhiy Storchaka added the comment:
Are there changes in handling empty values for other options? If yes, we
perhaps need to add version-dependent tests for empty values instead of just
skipping this case.
--
___
Python tracker
<ht
Serhiy Storchaka added the comment:
Two years is not so long for a bug. We fixed 8-year and 12-year bugs.
The issue is that this feature is internally inconsistent (isinstance() is not
consistent with issubclass()), the C implementation of list[int] is not
consistent with the Python
Serhiy Storchaka added the comment:
This is a duplicate of issue18510. It was also discussed on the Python-Dev
mailing list (maybe more than once). If you have some new arguments or
something in past 8 years made the old arguments no longer valid please open a
new discussion on the mailing
Serhiy Storchaka added the comment:
New changeset b1302abcc8a4be5f39b4d60a1ce28032b77655b3 by Alex Waygood in
branch 'main':
bpo-44904: Fix classmethod property bug in doctest module (GH-28838)
https://github.com/python/cpython/commit/b1302abcc8a4be5f39b4d60a1ce280
Serhiy Storchaka added the comment:
> issubclass(x, list[int]) rejects the second argument for reasons explained in
> the PEP.
1. One problem is that isinstance(x, type) != issubclass(type(x), type)
if x is list[int]. It is unprecedented, I cannot recall any other case
in which isin
Serhiy Storchaka added the comment:
See also issue40296.
--
___
Python tracker
<https://bugs.python.org/issue45438>
___
___
Python-bugs-list mailing list
Unsub
New submission from Serhiy Storchaka :
The repr of InitVar preserves type aliases from the typing module, but not
builtin.
>>> import typing, dataclasses
>>> dataclasses.InitVar[typing.List[int]]
dataclasses.InitVar[typing.List[int]]
>>> dataclasses.InitVar[list[int
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +27554
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29291
___
Python tracker
<https://bugs.python.org/issu
New submission from Serhiy Storchaka :
>>> import dataclasses, types
>>> @dataclasses.dataclass
... class A(types.GenericAlias):
... origin: type
... args: type
...
>>> dataclasses.is_dataclass(A)
True
>>> a = A(list, int)
>&g
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +27557
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29294
___
Python tracker
<https://bugs.python.org/issu
New submission from Serhiy Storchaka :
resolve_bases() returns incorrect result:
>>> import types
>>> types.resolve_bases((list[int],))
(list[int],)
Expected (list,).
new_class() fails:
>>> types.new_class('L', (list[int],), {})
Traceback (most rec
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +27562
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29298
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
pull_requests: -27569
___
Python tracker
<https://bugs.python.org/issue45664>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Serhiy Storchaka :
--
pull_requests: -27570
___
Python tracker
<https://bugs.python.org/issue45664>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Serhiy Storchaka :
This is a meta-issue for problems caused by isinstance(list[int]) returning
True.
See also discussion in issue45438.
--
components: Library (Lib)
messages: 405290
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title
Serhiy Storchaka added the comment:
isinstance(x, type) returns True for instances of types.GenericAlias (like
list[int]). While it may help in some cases related to typing, in many
unrelated cases it causes problems if the value which is not a type passes
checks for types.
Also
Serhiy Storchaka added the comment:
I have opened separate issues for different cases and a meta-issue45665 for
general discussion.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
type: -> behavior
versions: +Python 3.11
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
pull_requests: +27574
pull_request: https://github.com/python/cpython/pull/29305
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
New changeset 6b867022d926be9fcc6f8038fb1093ba8c348ca5 by Serhiy Storchaka in
branch '3.10':
[3.10] bpo-45502: Fix test_shelve (GH-29003) (GH-29305)
https://github.com/python/cpython/commit/6b867022d926be9fcc6f8038fb1093
Change by Serhiy Storchaka :
--
pull_requests: +27575
pull_request: https://github.com/python/cpython/pull/29306
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
New changeset a043706f907e82ee6a562005991ff0b896a4e64d by Serhiy Storchaka in
branch '3.9':
[3.9] [3.10] bpo-45502: Fix test_shelve (GH-29003) (GH-29305) (GH-29306)
https://github.com/python/cpython/commit/a043706f907e82ee6a562005991ff0
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
title: Problems caused by isinstance(list[int]) returning True -> Problems
caused by isinstance(list[int], type) returning True
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
PR 29316 looks complicated.
First of all, why do Enum needs a custom __dir__? What is wrong with the
default implementation?
--
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
Concur with Andrew.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue45671>
___
___
Python-bug
Serhiy Storchaka added the comment:
sre_parse.parse() is an internal function and this behaviour is an
implementation detail.
This change enabled some optimizations which did not work with non-capturing
groups before. It did not affect the matching itself.
--
nosy
2001 - 2100 of 25874 matches
Mail list logo