Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +18473
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19112
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
Many functions that accepts non-integer arguments (except float) and truncate
them to integers emits a deprecation warning since 3.8 (see issue36048 and
issue20092). They will be errors in 3.10 (see 37999
Serhiy Storchaka added the comment:
Using index() simplifies the code. Adding deprecation warnings complicates it.
The PR consists of two commits, look at the first one to see how the code can
finally look.
If you think that the deprecation is not needed, we can just keep the
simplified
Serhiy Storchaka added the comment:
If you are against deprecating this "feature", it should be at least documented
and covered by tests.
--
___
Python tracker
<https://bugs.python.o
New submission from Serhiy Storchaka :
The propose test adds several tests for random module. Mainly tests for
integer, sequence and iterable arguments.
It also documents that randrange() accepts non-integers.
--
assignee: docs@python
components: Documentation, Tests
messages: 364840
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +18475
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19114
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
What is wrong with adding more tests?
--
___
Python tracker
<https://bugs.python.org/issue40046>
___
___
Python-bugs-list m
Change by Serhiy Storchaka :
--
resolution: -> rejected
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
Thank you for catching this Fred. I am surprised that some code uses
xml.etree.cElementTree without falling back to xml.etree.ElementTree. In Python
3 you can just use xml.etree.ElementTree, in Python 2 you have to fallback to
the Python implementation
Serhiy Storchaka added the comment:
The common idiom is
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
--
___
Python tracker
<https://bugs.python.org/issue40
Serhiy Storchaka added the comment:
Could you please explain the difference between hypothetical
TemporaryDirectory(delete=False) and simple mkdtemp()?
--
___
Python tracker
<https://bugs.python.org/issue25
Serhiy Storchaka added the comment:
Well, then I think there is nothing to do this.
Compatibility with context manager protocol is not a goal if it does nothing on
exit. In any case you can easy to make it in three lines:
@contextmanager
def mymkdtemp():
yield mkdtemp
Serhiy Storchaka added the comment:
New changeset 6467134307cf01802c9f1c0384d8acbebecbd400 by Miro HronĨok in
branch 'master':
bpo-36543: What's new: Document how to replace xml.etree.cElementTree (GH-19188)
https://github.com/python/cpython/commit/6467134307cf01802c9f1c038
Change by Serhiy Storchaka :
--
nosy: +larry
priority: normal -> release blocker
versions: -Python 2.7, Python 3.6, Python 3.7, Python 3.8, Python 3.9
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
I am not sure that implementing a rich comparison of AST nodes is the right
way. There are too much options (compare attributes or not, compare recursively
or not, compare types or not) and __eq__ does not support options. In addition,
it requires
New submission from Serhiy Storchaka :
Due to the difference in the code of __getattr__ and __dir__ for object and
type dir() does not return the list of valid attributes for the object. It can
return a name which is not a valid attribute and miss a name of the valid
attribute.
1. It does
Serhiy Storchaka added the comment:
But the following class should not lead to unlimited memory consumption when
create new instances:
class C:
count = 0
def __init__(self):
count = self.__class__.count
self.__class__.count = count + 1
setattr(self, f'a{
Serhiy Storchaka added the comment:
I think the current behavior is a guard against such pitfall. If you allow to
add new keys when not all other keys are set, you can end with sharing growing
set of keys.
--
___
Python tracker
<ht
Serhiy Storchaka added the comment:
If you want to get a TypeError, raise a TypeError.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue40
Serhiy Storchaka added the comment:
Yes, of course. The PR adds new tests for different types of arguments which
currently are accepted (so it would be a regression if they will no accepted in
new releases or in alternate implementations) and for types which currently are
not accepted for
Serhiy Storchaka added the comment:
You can use lru_cache(maxsize=128, typed=False)(user_function). lru_cache
should support a function as an argument on if it is a single positional
argument, this is the purpose. So you can write
@lru_cache
def func(...):
...
instead of
@lru_cache
Serhiy Storchaka added the comment:
If CO_FUTURE_DIVISION conflicts with PyCF_ALLOW_TOP_LEVEL_AWAIT, does not
CO_ITERABLE_COROUTINE conflict with PyCF_SOURCE_IS_UTF8 and CO_ASYNC_GENERATOR
with PyCF_DONT_IMPLY_DEDENT?
--
___
Python tracker
Change by Serhiy Storchaka :
--
pull_requests: +18593
pull_request: https://github.com/python/cpython/pull/19236
___
Python tracker
<https://bugs.python.org/issue39
Serhiy Storchaka added the comment:
dis.findlabels() always worked with a byte code. And the docstring correctly
describes this.
I think this is a documentation issue. The documentation fix should be
backported to all maintained Python versions.
If you want to make dis.findlabels
Serhiy Storchaka added the comment:
I concur with Sam that we should keep compatibility with C++ in header files.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue40
Serhiy Storchaka added the comment:
5. dir(module) does not contain module type attributes (in contrary to dir()
for regular object).
>>> import keyword
>>> dir(keyword)
['__all__', '__builtins__', '__cached__', '__doc__', '
Serhiy Storchaka added the comment:
New changeset 2c003eff8fef430f1876adf88e466bcfcbd0cc9e by Serhiy Storchaka in
branch 'master':
bpo-39943: Clean up marshal.c. (GH-19236)
https://github.com/python/cpython/commit/2c003eff8fef430f1876adf88e466b
New submission from Serhiy Storchaka :
There are many tests for int-like objects (which implement custom __index__ or
__int__ methods) in different files. There are less tests for float-like
objects (with the __float__ method). There are even tests for complex-like
(with the __complex__
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +18618
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19262
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
If using __class__ and __dict__ attribuites is a feature, it does not work for
__getattr__(). I think it is confusing if __dir__() and __getattr__() are not
consistent. I'll try to deal with unittes.mock and then will look how this will
work with
New submission from Serhiy Storchaka :
_PyUnicode_AsKind is exposed as private C API. It is only used in
unicodeobject.c, where it is defined. Its name starts with an underscore, it is
not documented and not included in PC/python3.def (therefore is not exported on
Windows). Seems it is not
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +18622
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19265
___
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
Serhiy Storchaka added the comment:
New changeset 17b4733f2ff0a4abc06e8c745755c06fc32942dd by Serhiy Storchaka in
branch 'master':
bpo-40130: _PyUnicode_AsKind() should not be exported. (GH-19265)
https://github.com/python/cpython/commit/17b4733f2ff0a4abc06e8c745755c0
Serhiy Storchaka added the comment:
AFAIK extern "C" only affects mangling of function names. Because of
overloading in C++ you can have several functions with the same name, and to
distinguish "int abs(int)" from "float abs(float)" the C++ compiler mangles
f
Serhiy Storchaka added the comment:
New changeset b74468e233a5137ff518e61eff65ca2d8833e38a by laike9m in branch
'master':
bpo-40122: Updated documentation for dis.findlabels() (GH-19274)
https://github.com/python/cpython/commit/b74468e233a5137ff518e61eff65ca
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: +18709
pull_request: https://github.com/python/cpython/pull/19345
___
Python tracker
<https://bugs.python.org/issue39
Serhiy Storchaka added the comment:
I think that the current code is not correct. __exit__ should not be called if
__enter__ is failed. If some __enter__ implementation calls other __enter__s it
should manually call corresponding __exit__s.
--
nosy: +michael.foord, ncoghlan
Change by Serhiy Storchaka :
--
pull_requests: +18714
pull_request: https://github.com/python/cpython/pull/19351
___
Python tracker
<https://bugs.python.org/issue40
Serhiy Storchaka added the comment:
I do not think there is clearer example of topdown=False than recursive remove.
If you think that this example is destructive, consider how destructive is any
possible example for shutil.rmtree()!
--
nosy: +serhiy.storchaka
Serhiy Storchaka added the comment:
It could be even better. Inside the tokenizer we know where the string literal
starts and what quotes it uses. The line and the offset of the *start* of the
literal can be set in a SyntaxError.
--
nosy: +serhiy.storchaka
Serhiy Storchaka added the comment:
This is a duplicate of issue700858 and issue6818.
--
___
Python tracker
<https://bugs.python.org/issue40175>
___
___
Pytho
Serhiy Storchaka added the comment:
There were other issues and discussions about this.
The problem of removing a file from a ZIP archive is similar to the problem of
removing a line from a file. It cannot be made efficiently, and it is not even
always possible. In some cases it may be
New submission from Serhiy Storchaka :
The proposed PR converts os.getgrouplist(), os.initgroups(), os.sendfile() and
os.get_terminal_size() to Argument Clinic.
--
components: Extension Modules
messages: 365762
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +18722
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19360
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
components: +Argument Clinic
nosy: +larry
___
Python tracker
<https://bugs.python.org/issue40178>
___
___
Python-bugs-list mailin
Serhiy Storchaka added the comment:
The problems which prevented their conversions before (in issue20170):
1. os.sendfile() had parameter names conflicting with Python keywords. Was
solved in issue38378.
2. os.get_terminal_size() has an optional argument without default value. It
was
Change by Serhiy Storchaka :
--
keywords: +patch
nosy: +serhiy.storchaka
nosy_count: 3.0 -> 4.0
pull_requests: +18725
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19363
___
Python tracker
<https://bugs.p
New submission from Serhiy Storchaka :
It converts
#if A
...
#elif B
...
#else
...
#endif
into
#if A
...
#endif /* A */
#if B
...
#endif /* B */
#if !B
...
#endif /* !B */
The correct translation is:
#if A
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +18726
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19364
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
pull_requests: +18727
pull_request: https://github.com/python/cpython/pull/19360
___
Python tracker
<https://bugs.python.org/issue40
Serhiy Storchaka added the comment:
New changeset a94e6272f16381349dbed74cdb738ec8ae23b4fe by Serhiy Storchaka in
branch 'master':
bpo-36517: Raise error on multiple inheritance with NamedTuple (GH-19363)
https://github.com/python/cpython/commit/a94e6272f16381349dbed74cdb738e
New submission from Serhiy Storchaka :
It was deprecated since 3.8 (see issue36320). The __annotations__ attribute has
the same information.
--
components: Library (Lib)
messages: 365780
nosy: gvanrossum, levkivskyi, rhettinger, serhiy.storchaka
priority: normal
severity: normal
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +18730
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19368
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
nosy_count: 4.0 -> 5.0
pull_requests: +18732
pull_request: https://github.com/python/cpython/pull/19370
___
Python tracker
<https://bugs.python.org/issu
New submission from Serhiy Storchaka :
typing.NamedTuple is used in two ways.
1. It is a callable which produces a new namedtuple type.
2. It can also be used as a base in the class statement for creating a new
namedtuple type.
In both cases it is not a real class. You cannot create an
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +18733
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19371
___
Python tracker
<https://bugs.python.org/issu
New submission from Serhiy Storchaka :
typing.TypedDict is used in two ways.
1. It is a callable which produces a new pseudo-subtype of dict.
2. It can also be used as a base in the class statement for creating a new
pseudo-subtype of dict.
In both cases it is not a real class. You cannot
Serhiy Storchaka added the comment:
See also issue40187.
--
___
Python tracker
<https://bugs.python.org/issue40185>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
See also issue40185.
--
___
Python tracker
<https://bugs.python.org/issue40187>
___
___
Python-bugs-list mailing list
Unsub
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +18734
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19372
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
See PR 19360 for real example.
--
___
Python tracker
<https://bugs.python.org/issue40179>
___
___
Python-bugs-list mailin
Serhiy Storchaka added the comment:
All works as expected to me. Your __class__ attribute raise an arbitrary
exception, and it is expected, that the code which uses it passes it to you.
I am against silencing all exceptions. It may hide bugs.
It is even documented. See What's New in P
Serhiy Storchaka added the comment:
New changeset 0d1d7c8bae3f9fe9e937d2931dcbbd3555d1a9f1 by Serhiy Storchaka in
branch '3.8':
bpo-36320: Use the deprecated-removed directive for _field_types (GH-19370)
https://github.com/python/cpython/commit/0d1d7c8bae3f9fe9e937d2931dcbbd
Serhiy Storchaka added the comment:
New changeset 6fed3c85402c5ca704eb3f3189ca3f5c67a08d19 by Serhiy Storchaka in
branch 'master':
bpo-40182: Remove the _field_types attribute of the NamedTuple class (GH-19368)
https://github.com/python/cpython/commit/6fed3c85402c5ca704eb3f3189ca3f
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
> Sorry, I should have quoted the doc. " If object is not an object of the
> given type, the function always returns False." Raising instead is a bug --
> even of the object itself is somewhat buggy.
You take it too literally. It doe
Serhiy Storchaka added the comment:
I get it printed two times.
Actually I get it printed four times: two time when compile the test script
(use r"'\d'" or "'\\d'" to get rid of them), and other two times when call
compile() inside a script.
$
Serhiy Storchaka added the comment:
Maybe copy the code for deprecated and removed features to Doc/tools/extensions?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue40
Serhiy Storchaka added the comment:
You can just use open() in binary mode.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue40
Serhiy Storchaka added the comment:
It would be inconvenient to require adding Py_VISIT(Py_TYPE(self)) in all
tp_visit implementations of heap allocated types (including third-party
extensions). Since tp_visit is GC specific thing, I think it wold be more
convenient make a special case for
Serhiy Storchaka added the comment:
Interesting, this issue may be related to issue24379. The problem with the
proposed implementation of subscript was that it created a reference loop, and
not all links in this loop were visible by GC
Serhiy Storchaka added the comment:
Recently many static allocated types were converted to heap allocated types
(using PyType_FromSpec). Now you need to add Py_VISIT(Py_TYPE(self)) in all
corresponding tp_visit implementations.
And since even official example for heap allocated types do not
Serhiy Storchaka added the comment:
The problem is that we suddenly changed rules. It was not required that the
object's type should be visited in tp_visit. It was incorrect to visit it,
because object did not have strong reference to its type. User never created
it, and it was not cr
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue39481>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
New changeset a2ec06938f46683e33692615aca3875d8b8e110c by Serhiy Storchaka in
branch 'master':
bpo-40185: Refactor typing.NamedTuple (GH-19371)
https://github.com/python/cpython/commit/a2ec06938f46683e33692615aca387
Serhiy Storchaka added the comment:
New changeset f228bf2300a9d3bf833b1a89336581822e864ae5 by Serhiy Storchaka in
branch 'master':
bpo-40187: Refactor typing.TypedDict. (GH-19372)
https://github.com/python/cpython/commit/f228bf2300a9d3bf833b1a89336581
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> 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
Serhiy Storchaka added the comment:
+1! I was going to implement this, but first I wanted to implement support of
line number ranges instead of just line numbers (co_lineno). We need to design
some compact portable format for address to address mapping (or address range
to address mapping
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue40228>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
I afraid there may be confusion between triple, double and single quoted string
literals. So I suggest to change error messages to just "unterminated
triple-quoted string literal" and "unterminated string literal" (or
"untermin
Serhiy Storchaka added the comment:
It was discussed in issue39816.
I do not think that calling len() and ignoring any exception is a good idea.
1. This may silence some exceptions (errors in the __len__ implementation,
MemoryError, RecursionError, KeyboardInterrupt) which should not be
New submission from Serhiy Storchaka :
It would be useful to have a function in itertools to merge sorted iterables.
merge_sorted(*iterables, key=None, reverse=False):
It should emit the same items as sorted(tee(*iterables), key=key,
reverse=reverse) if iterables are sorted with key and
Serhiy Storchaka added the comment:
Thank you Tim, it is exactly what I need!
I got this search result, but I rejected it because it looked obvious that the
function from the heapq module cannot have any relation to this. :(
I meant chain() instead of tee(), sorry.
--
resolution
Change by Serhiy Storchaka :
--
nosy: +Mark.Shannon, serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue40225>
___
___
Python-bugs-list mailin
Serhiy Storchaka added the comment:
How are ipaddress and mmap generic?
--
___
Python tracker
<https://bugs.python.org/issue39481>
___
___
Python-bugs-list m
Serhiy Storchaka added the comment:
globals is only used when level > 0, to resolve relative names like in `import
..foo`. You have to set keys __package__ and __spec__ or __name__ and __path__
in this case.
--
nosy: +serhiy.storchaka
___
Pyt
Change by Serhiy Storchaka :
--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
___
Python tracker
<https://bugs.python.org/issue40
Serhiy Storchaka added the comment:
I cannot reproduce the issue. __exit__() calls close().
>>> import io
>>> class F(io.IOBase):
... def close(self):
... print('close')
... super().close() # set closed = True
...
>>> with
Serhiy Storchaka added the comment:
New changeset cd8295ff758891f21084a6a5ad3403d35dda38f7 by Serhiy Storchaka in
branch 'master':
bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data.
(GH-19345)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
New changeset 4b222c9491d1700e9bdd98e6889b8d0ea1c7321e by Serhiy Storchaka in
branch 'master':
bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351)
https://github.com/python/cpython/commit/4b222c9491d1700e9bdd98e6889b8d
Change by Serhiy Storchaka :
--
resolution: -> rejected
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
pull_requests: +18827
pull_request: https://github.com/python/cpython/pull/19472
___
Python tracker
<https://bugs.python.org/issue39
New submission from Serhiy Storchaka :
Currently pydoc outputs __doc__ for classes, functions, methods, properties,
etc (using inspect.getdoc()). If the object itself does not have non-empty
__doc__, it searches non-empty __doc__ in the class parenthesis (if the object
is a class) or in the
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +18833
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19479
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
Inheritance of docstrings was added in issue15582. It works good for class
members, but I now realized that doing it for class itself was a mistake. For
example:
>>> import wave
>>> help(wave.Error)
Help on class Error in module
Change by Serhiy Storchaka :
--
pull_requests: +18835
pull_request: https://github.com/python/cpython/pull/19483
___
Python tracker
<https://bugs.python.org/issue40
Change by Serhiy Storchaka :
--
pull_requests: +18837
pull_request: https://github.com/python/cpython/pull/19484
___
Python tracker
<https://bugs.python.org/issue40
2701 - 2800 of 25874 matches
Mail list logo