[issue42182] 3.10 Documentation Not Hyperlinking Some Methods

2021-12-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 8c74713d0e349c27518080945d5f040dfd52a56e by andrei kulakov in 
branch 'main':
bpo-42182: stdtypes doc - update and fix links to several dunder methods  
(GH-27384)
https://github.com/python/cpython/commit/8c74713d0e349c27518080945d5f040dfd52a56e


--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue42182>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46000] NetBSD curses compatibility

2021-12-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2fb797e93c6bbd44dfcbe23f63acfa240a87e48a by Thomas Klausner in 
branch 'main':
bpo-46000: Improve NetBSD curses compatibility (GH-29947)
https://github.com/python/cpython/commit/2fb797e93c6bbd44dfcbe23f63acfa240a87e48a


--

___
Python tracker 
<https://bugs.python.org/issue46000>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45662] Incorrect repr of InitVar of a type alias

2021-12-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset fb8aad16401e081a6a9059c7b428f7e8aae85d58 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-45662: Fix the repr of InitVar with a type alias to the built-in 
class (GH-29291) (GH-29924)
https://github.com/python/cpython/commit/fb8aad16401e081a6a9059c7b428f7e8aae85d58


--

___
Python tracker 
<https://bugs.python.org/issue45662>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45662] Incorrect repr of InitVar of a type alias

2021-12-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue45662>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46000] NetBSD curses compatibility

2021-12-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 040f9f9c48f4e74e851d850275aa9e050a04d0c6 by Miss Islington (bot) 
in branch '3.9':
bpo-46000: Improve NetBSD curses compatibility (GH-29947) (GH-30023)
https://github.com/python/cpython/commit/040f9f9c48f4e74e851d850275aa9e050a04d0c6


--

___
Python tracker 
<https://bugs.python.org/issue46000>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46000] NetBSD curses compatibility

2021-12-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Thomas for your contribution.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46000>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45665] Problems caused by isinstance(list[int], type) returning True

2021-12-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies: +functools' singledispatch does not support GenericAlias

___
Python tracker 
<https://bugs.python.org/issue45665>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45665] Problems caused by isinstance(list[int], type) returning True

2021-12-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies:  -functools' singledispatch does not support GenericAlias

___
Python tracker 
<https://bugs.python.org/issue45665>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46032] functools' singledispatch does not support GenericAlias

2021-12-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue46032>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45929] extend json.tool --json-lines to ignore empty rows

2021-12-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The current implementation allows for the final character of the input to be a 
newline. It does not allow double newlines. In the original example 

   echo -e '{"foo":1}\n{"bar":2}\n'

the echo command adds a newline to the output (which already contains the 
trailing newline), so the result ends with two newlines. Use option -n to 
disable adding newline in echo.

I afraid that if we add support of empty lines, soon we will get requests for 
supporting comments, encoding cookies, single-quote strings, non-quoted keys, 
hexadecimal integers and other possible JSON extensions.

--

___
Python tracker 
<https://bugs.python.org/issue45929>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21964] inconsistency in list-generator comprehension with yield(-from)

2021-12-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Resolved in issue10544.

--
nosy: +serhiy.storchaka
resolution: out of date -> duplicate
stage: test needed -> resolved
status: pending -> closed
superseder:  -> yield expression inside generator expression does nothing

___
Python tracker 
<https://bugs.python.org/issue21964>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46032] functools' singledispatch does not support GenericAlias

2021-12-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +28275
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30050

___
Python tracker 
<https://bugs.python.org/issue46032>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46032] functools' singledispatch does not support GenericAlias

2021-12-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, it is related to issue45665. It is a complicated case due to coincidence 
of several circumstances.

1. isinstance(list[int], type) is True, while isinstance(typing.List[int], 
type) is False. list[int] is considered a type in this check.

2. list[int].__mro__ == list.__mro__, while typing.List[int] does not have the 
__mro__ attribute.  list[int] is considered a type in this check.

3. issubclass(cls, list[int]) raises a TypeError (the same for 
typing.List[int]). list[int] cannot be used as a type here.

4. 2-argument registry() does not check the type of its first argument. 
f.registry(42, ...) is silently passed.

In 2-argument registry() typing.List[int] is passed due to (4) and ignored in 
dispatch() due to (2). list[int] is passed due to (4), but caused error due to 
(3).

In other uses of registry() (1-argument decorator factory and decorator with 
annotations) typing.List[int] is not passed due to 1. list[int] is passed due 
to (1) and caused error due to (3).

The proposed PR makes list[int] be treated the same way as typing.List[int]. It 
also makes 2-argument registry() rejecting invalid first argument, so all three 
forms of registry() accept and reject now the same types.

--
versions: +Python 3.10, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46032>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45665] Problems caused by isinstance(list[int], type) returning True

2021-12-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies: +functools' singledispatch does not support GenericAlias

___
Python tracker 
<https://bugs.python.org/issue45665>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2021-12-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
nosy: +serhiy.storchaka
nosy_count: 6.0 -> 7.0
pull_requests: +28283
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30063

___
Python tracker 
<https://bugs.python.org/issue27718>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2021-12-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is due to use functools.wraps(). If __all__ is not defined all non-builtin 
functions should have correct __module__ to be displayed by pydoc. 
functools.wraps() assigns __module__, __name__, __qualname__, __doc__ and 
__annotations__. __module__ should be preserved ('signal', not '_signal'), 
__name__ and __qualname__ are already correct, __annotations__ does not exist. 
So only __doc__ should be copied.

--

___
Python tracker 
<https://bugs.python.org/issue27718>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29221] ABC Recursion Error on isinstance() with less than recursion limit class hierarchy depth

2021-12-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is still reproducible if increase the depth. In 3.8-3.10 it needs 329 nested 
classes, in 3.11 -- 496.

Seems the limit is sys.getrecursionlimit()//k - 4, where k=4 in 3.7 and older, 
k=3 in 3.8-3.10, and k=2 in 3.11. It is much better than was initially, but the 
ideal is k=1.

--
resolution: out of date -> 
stage: resolved -> 
status: closed -> open
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6, Python 3.7

___
Python tracker 
<https://bugs.python.org/issue29221>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46055] Speed up binary shifting operators

2021-12-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Could you please show any microbenchmarking results?

--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue46055>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45840] Improve cross-references in the data model documentation

2021-12-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7da90251ae80f5faac938b659675ff159d565537 by Alex Waygood in 
branch '3.10':
bpo-45840: Improve cross-references in the data model documentation (GH-29633) 
(GH-30077)
https://github.com/python/cpython/commit/7da90251ae80f5faac938b659675ff159d565537


--

___
Python tracker 
<https://bugs.python.org/issue45840>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2021-12-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e08c0d8eec528f1d7a282ee19bcadb9aae9ec123 by Serhiy Storchaka in 
branch 'main':
bpo-27718: Fix help for the signal module (GH-30063)
https://github.com/python/cpython/commit/e08c0d8eec528f1d7a282ee19bcadb9aae9ec123


--

___
Python tracker 
<https://bugs.python.org/issue27718>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2021-12-13 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +28301
pull_request: https://github.com/python/cpython/pull/30080

___
Python tracker 
<https://bugs.python.org/issue27718>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2021-12-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e55deaabd8de338138cf29aea6890996e794c997 by Serhiy Storchaka in 
branch '3.10':
[3.10] bpo-27718: Fix help for the signal module (GH-30063) (GH-30080)
https://github.com/python/cpython/commit/e55deaabd8de338138cf29aea6890996e794c997


--

___
Python tracker 
<https://bugs.python.org/issue27718>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2021-12-13 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue27718>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45840] Improve cross-references in the data model documentation

2021-12-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2029c58097e49b5aedc152ab65958a9db35ebd1e by Alex Waygood in 
branch '3.9':
 [3.9] bpo-45840: Improve cross-references in the data model documentation 
(GH-29633) (GH-30081)
https://github.com/python/cpython/commit/2029c58097e49b5aedc152ab65958a9db35ebd1e


--

___
Python tracker 
<https://bugs.python.org/issue45840>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45840] Improve cross-references in the data model documentation

2021-12-13 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue45840>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46065] re.findall takes forever and never ends

2021-12-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It ends, but it tooks several minutes to complete.

It is a limitation of the regular expression implementation in Python. Your 
input contains a sequence of 588431 characters which match the pattern 
[a-zA-Z0-9_.+-] not following by '@'. The engine finds the first character in 
this sequence, then scans 588431 characters matching this pattern, but does not 
find '@' after them. So it backtracks, steps back by one character and tries to 
match '@', fails, and continue stepping back until returns to the initial 
character. 588431 steps forward and 588431 steps back are needed to find that 
no matches starting at this position. So it steps forward and try the 
proce3dure from a new position. No it does 588430 steps in both direction. 
Totally it needs to do 588431+588430+588429+...+1 ~ 588431**2/2 ~ 173e9 steps. 
It takes a long time.

--

___
Python tracker 
<https://bugs.python.org/issue46065>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46065] re.findall takes forever and never ends

2021-12-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The simplest example is:

re.search('a@', 'a'*10)

--

___
Python tracker 
<https://bugs.python.org/issue46065>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46065] re.findall takes forever and never ends

2021-12-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Limit the number of repetitions. For example use "{1,100}" (or what is the 
expected maximal length of email) instead of "+".

--

___
Python tracker 
<https://bugs.python.org/issue46065>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46062] tkinter.filedialog.SaveAs: create new folder on Ubuntu?

2021-12-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

On other systems it opens a simple dialog window implemented in Tk. AFAIK it 
does not support creating new directories. Ask Tk core developers for a new 
feature.

--
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46062>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23148] Missing the charset parameter in as_encoded_word()

2021-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The code was completely rewritten in issue27240. No tests are needed.

--
resolution:  -> fixed
stage: test needed -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue23148>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31370] Remove support for threads-less builds

2021-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Concur with Victor. It is fine to add a link to other discussion in a closed 
issue, but an issue closed many years ago is not a good place for a new 
discussion at all.

--

___
Python tracker 
<https://bugs.python.org/issue31370>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46069] Super Smash Flash 2

2021-12-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46069>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

os.walk() has been implemented via os.scandir(), but by default it ignores 
OSErrors raised by os.scandir(), DirEntry.is_dir() and DirEntry.is_symlink(). 
You can get errors raised by os.scandir() if specify the onerror argument, but 
errors in DirEntry.is_dir() and DirEntry.is_symlink() are always ignored, so 
too deep directories or links to directories can be treated as files.

--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue46084>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46087] Zip library documentation error

2021-12-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Since it is a REPL example, no print() is needed. In REPL any expression 
statement prints the repr of its result. For example:

>>> for x in range(1, 5):
... f'{x}**2 = {x**2}'
... 
'1**2 = 1'
'2**2 = 4'
'3**2 = 9'
'4**2 = 16'

There are many such examples in the documentation, and I do not think that this 
particular example needs a change.

--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue46087>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46087] format library documentation error

2021-12-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +eric.smith
resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46087>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22815] unexpected successes are not output

2021-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think the OP means that test details (test description, traceback, captured 
output) are printed for ERROR and FAIL in TextTestResult.printErrors(). Other 
possible results besides error and failure are success, skipped, expected 
failure and unexpected success. Success, skipped and expected failure are 
expected, they do not cause total failure, but unexpected success is different. 
Result.wasSuccessful() returns False if there are any errors, failures or 
unexpected successes. But unlike errors and failures we do not have any details 
about unexpected successes. It looks like oversight to me.

Yes, there are no traceback for unexpected success, but at least we can output 
the test description and captured output.

--
assignee:  -> serhiy.storchaka
nosy: +ezio.melotti, michael.foord, serhiy.storchaka
resolution: out of date -> 
status: pending -> open
versions: +Python 3.11 -Python 3.5

___
Python tracker 
<https://bugs.python.org/issue22815>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22815] unexpected successes are not output

2021-12-16 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +28356
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30138

___
Python tracker 
<https://bugs.python.org/issue22815>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22815] unexpected successes are not output

2021-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are no other details for unexpected successes, only test descriptions.

--
type: behavior -> enhancement

___
Python tracker 
<https://bugs.python.org/issue22815>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46094] Missing unit test on unittest.TestResult to check for required arguments

2021-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What do you mean they are required? All parameters of TestResult() are optional.

--
nosy: +ezio.melotti, michael.foord, rbcollins, serhiy.storchaka
status: pending -> open

___
Python tracker 
<https://bugs.python.org/issue46094>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22815] unexpected successes are not output

2021-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Unless you tun tests in verbose mode you do not know which of tests was 
unexpectedly successful. And even in the verbose mode it is not easy to find 
that test in long output.

Yes, unexpected successes considered successes in earlier versions. See 
issue20165.

You can find many interesting when read git logs.

--

___
Python tracker 
<https://bugs.python.org/issue22815>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20165] unittest TestResult wasSuccessful returns True when there are unexpected successes

2021-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See also issue22815.

--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue20165>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls)

2021-12-16 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue36674>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12681] unittest expectedFailure could take a message argument like skip does

2021-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Such change would break a lot of existing interfaces.

* addUnexpectedSuccess() has a single parameter. The change will add the second 
parameter and will break subclasses of TestResult.
* addExpectedFailure() has two parameter. The change will add the third 
parameter and will break subclasses of TestResult.
* unexpectedSuccesses is a list of tests. The change will make it a list of 
2-tuples and will break users of TestResult.
* expectedFailures is a list of 2-tuples. The change will make it a list of 
3-tuples and will break users of TestResult.

It is too destructive change. I think we can live without a message argument 
for expectedFailure().

--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue12681>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46111] test_unittest fails in optimized mode

2021-12-16 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

$ ./python -OO -m test -vuall test_unittest
...
==
FAIL: testShortDescriptionWhitespaceTrimming 
(unittest.test.test_case.Test_TestCase)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_case.py", line 639, in 
testShortDescriptionWhitespaceTrimming
self.assertEqual(
^
AssertionError: None != 'Tests shortDescription() whitespace is trimmed, so 
that the first'

==
FAIL: test_Exit (unittest.test.test_program.Test_TestProgram)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_program.py", line 127, 
in test_Exit
self.assertIn('\nFAIL: testFail ', stream.getvalue())
^
AssertionError: '\nFAIL: testFail ' not found in 
'..\n--\nRan
 2 tests in 0.000s\n\nOK\n'

==
FAIL: test_ExitAsDefault (unittest.test.test_program.Test_TestProgram)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_program.py", line 139, 
in test_ExitAsDefault
self.assertIn('\nFAIL: testFail ', stream.getvalue())
^
AssertionError: '\nFAIL: testFail ' not found in 
'..\n--\nRan
 2 tests in 0.000s\n\nOK\n'

==
FAIL: test_NonExit (unittest.test.test_program.Test_TestProgram)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_program.py", line 114, 
in test_NonExit
self.assertIn('\nFAIL: testFail ', stream.getvalue())
^
AssertionError: '\nFAIL: testFail ' not found in 
'..\n--\nRan
 2 tests in 0.000s\n\nOK\n'

==
FAIL: test_special_attrs (unittest.test.testmock.testpatch.PatchTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/testmock/testpatch.py", line 
1880, in test_special_attrs
self.assertEqual(foo.__doc__, "TEST")
^
AssertionError: None != 'TEST'

--

--
assignee: serhiy.storchaka
components: Tests
messages: 408755
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: test_unittest fails in optimized mode
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46111>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46111] test_unittest fails in optimized mode

2021-12-16 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +28380
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30163

___
Python tracker 
<https://bugs.python.org/issue46111>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46111] test_unittest fails in optimized mode

2021-12-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 95a922b3bb3af247ec141d73fcdfbf68bb1d32a5 by Serhiy Storchaka in 
branch 'main':
bpo-46111: Fix unittest tests in optimized mode (GH-30163)
https://github.com/python/cpython/commit/95a922b3bb3af247ec141d73fcdfbf68bb1d32a5


--

___
Python tracker 
<https://bugs.python.org/issue46111>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46112] PEP 8 code format

2021-12-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PEP 8 is a guide for writing new code. It does not require rewriting the old 
code. In fact, patches with mass reformatting of the stdlib code have always 
been rejected.

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46112>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46111] test_unittest fails in optimized mode

2021-12-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46111>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46128] Strip IsolatedAsyncioTestCase frames from reported stacktraces

2021-12-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you. I knew about this issue but forgot to fix it.

I think it is also needed in _log.py. Not sure about mock.py.

--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue46128>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46131] Add PyType_FastSubclass for float

2021-12-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is because PyFloat_Check() and PyComplex_Check() are rarely used in 
comparison with checks for integers, strings, etc. The flags space is limited, 
so it is better to use it for something more important.

There were reasons for not adding such flags at first place and I think that 
they are still valid.

--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue46131>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46094] Missing unit test on unittest.TestResult to check for required arguments

2021-12-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

These parameters were added in d99ef9a9df093d3443996725cd9dcac5f113f176, but 
they were not tested nor documented. An indirect test was added later in 
issue12376.

If it is an official feature it needs documentation and tests. Otherwise we can 
remove these parameters and revert issue12376 changes. Michael?

--

___
Python tracker 
<https://bugs.python.org/issue46094>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23819] test_asyncio fails when run under -O

2021-12-20 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
nosy_count: 5.0 -> 6.0
pull_requests: +28433
pull_request: https://github.com/python/cpython/pull/30212

___
Python tracker 
<https://bugs.python.org/issue23819>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23819] test_asyncio fails when run under -O

2021-12-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6ca78affc8023bc5023189d64d8050857662042a by Serhiy Storchaka in 
branch 'main':
bpo-23819: Get rid of assert statements in test_asyncio (GH-30212)
https://github.com/python/cpython/commit/6ca78affc8023bc5023189d64d8050857662042a


--

___
Python tracker 
<https://bugs.python.org/issue23819>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37295] Possible optimizations for math.comb()

2021-12-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

factorial(49) has 163 significant binary digits. It cannot be represented in 
floating-point without losses. And C functions log2() and exp2() can add 
additional errors, depending on platform. We rely on the assumption that all 
errors will be compensated, but there are no guaranties of this.

--

___
Python tracker 
<https://bugs.python.org/issue37295>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23819] test_asyncio fails when run under -O

2021-12-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 95948169d75bed3936284ea2225e83e07ec5fe20 by Miss Islington (bot) 
in branch '3.10':
bpo-23819: Get rid of assert statements in test_asyncio (GH-30212) (GH-30213)
https://github.com/python/cpython/commit/95948169d75bed3936284ea2225e83e07ec5fe20


--

___
Python tracker 
<https://bugs.python.org/issue23819>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46051] Make @atexit.register work for functions with arguments

2021-12-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It cannot work this way.

atexit.register() as a function allows you to specify arguments which will be 
passed to the registered function, but if it is used as a decorator, only one 
argument (the function itself) is passed to atexit.register() (it is how 
decorators work). When used as a decorator it can only register functions 
without parameters.

On other hand, the function corresponding to a class method requires the class 
argument. There is no magic to determine it at the decoration time, because the 
class does not exist yet. It will be created only after the class definition 
body be executed.

It is possible to create a decorator which work the way you want. The simplest 
method perhaps to create a classmethod subclass with __set_name__() method. 
__set_name__() will be called after creating the class.

class mydecorator(classmethod):
def __set_name__(self, type, name):
atexit.register(self.__func__, type)

class Program:
@mydecorator
def clean_up(cls):
...

--

___
Python tracker 
<https://bugs.python.org/issue46051>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37295] Possible optimizations for math.comb()

2021-12-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

long long is at least 64 bit, so we can safely use PyLong_FromLongLong() for 
int64_t.

--

___
Python tracker 
<https://bugs.python.org/issue37295>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46140] Some API methods could take const Py_buffer* instead of Py_buffer *

2021-12-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 31ff96712e8f89ac1056c2da880b44650002219f by David Hewitt in 
branch 'main':
bpo-46140: take more Py_buffer arguments as const * (GH-30217)
https://github.com/python/cpython/commit/31ff96712e8f89ac1056c2da880b44650002219f


--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue46140>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46140] Some API methods could take const Py_buffer* instead of Py_buffer *

2021-12-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your contribution David.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46140>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46160] IPy->IPSet AttributeError: module 'collections' has no attribute 'MutableSet'

2021-12-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46160>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46157] Typo in JSON documentation

2021-12-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are other similar errors:

Doc/library/json.rst:162:   will result in an :exc:`RecursionError` (or worse).
Doc/library/json.rst:435:   prevent an infinite recursion (which would cause an 
:exc:`RecursionError`).
Doc/library/tarfile.rst:66:   |  | Raise an 
:exc:`FileExistsError` exception   |
Doc/library/tarfile.rst:70:   |  | Raise an 
:exc:`FileExistsError` exception   |
Doc/library/tarfile.rst:74:   |  | Raise an 
:exc:`FileExistsError` exception   |
Doc/library/tarfile.rst:78:   |  | Raise an 
:exc:`FileExistsError` exception   |
Doc/library/poplib.rst:124:An :class:`POP3` instance has the following methods:
Doc/library/urllib.request.rst:1112:   implementation will raise an 
:exc:`ValueError` in that case.
Doc/library/enum.rst:180:  Returns the Enum member in *cls* matching 
*name*, or raises an :exc:`KeyError`::
Doc/library/os.rst:2084:   If *exist_ok* is ``False`` (the default), an 
:exc:`FileExistsError` is
Doc/library/os.rst:2360:   not empty, an :exc:`FileNotFoundError` or an 
:exc:`OSError` is raised
Doc/library/asyncio-eventloop.rst:900:  method, before Python 3.7 it 
returned an :class:`Future`.
Doc/library/asyncio-eventloop.rst:1085:   The *executor* argument should be an 
:class:`concurrent.futures.Executor`
Doc/whatsnew/3.9.rst:700::pep:`593` introduced an :data:`typing.Annotated` type 
to decorate existing

--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue46157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46157] Typo in JSON documentation

2021-12-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Doc/using/cmdline.rst:474:   * ``-X warn_default_encoding`` issues a 
:class:`EncodingWarning` when the
Doc/c-api/init_config.rst:601:  If non-zero, emit a :exc:`EncodingWarning` 
warning when :class:`io.TextIOWrapper`
Doc/library/fractions.rst:90:  and *denominator*. :func:`math.gcd` always 
return a :class:`int` type.
Doc/library/asyncio-future.rst:122:  a :exc:`InvalidStateError` exception.
Doc/library/asyncio-future.rst:128:  Raises a :exc:`InvalidStateError` 
error if the Future is
Doc/library/asyncio-future.rst:135:  Raises a :exc:`InvalidStateError` 
error if the Future is
Doc/library/inspect.rst:402:  wrapped function is a :term:`asynchronous 
generator` function.
Doc/library/importlib.rst:881:   Returns a 
:class:`importlib.abc.Traversable` object for the loaded
Doc/library/importlib.rst:960:Given a 
:class:`importlib.resources.abc.Traversable` object representing
Doc/library/pathlib.rst:721:   Return a :class:`os.stat_result` object 
containing information about this path, like :func:`os.stat`.
Doc/library/os.rst:3412:   Provide semaphore-like semantics for reads from a 
:func:`eventfd` file
Doc/library/asyncio-task.rst:947:  a :exc:`InvalidStateError` exception.
Doc/library/ast.rst:782:   be a :class:`Name`, a :class:`Attribute` or a 
:class:`Subscript`.
Doc/library/ast.rst:1772:   must be wrapped in a :class:`Expr` node if the 
value sent back is not used.
Doc/library/asyncio-eventloop.rst:116:   is implicitly scheduled to run as a 
:class:`asyncio.Task`.
Doc/library/asyncio-eventloop.rst:357:   must return a 
:class:`asyncio.Future`-compatible object.
Doc/library/asyncio-eventloop.rst:1129:   This method returns a 
:class:`asyncio.Future` object.
Doc/glossary.rst:113:  An object created by a :term:`asynchronous 
generator` function.
Doc/reference/expressions.rst:216:clause may be used to iterate over a 
:term:`asynchronous iterator`.
Doc/reference/expressions.rst:710:   This method is normally called implicitly 
by a :keyword:`async for` loop.
Doc/whatsnew/3.7.rst:607:a :class:`importlib.abc.ResourceReader` instance to 
support this
Misc/NEWS.d/3.10.0a1.rst:825:``True``, ``False`` and ``None`` are used within a 
:class:`ast.Name` node.
Misc/NEWS.d/3.9.0a4.rst:407:always return a :class:`int` type. Previously, the 
GCD type depended on
Misc/NEWS.d/3.9.0b1.rst:394:When a :class:`asyncio.Task` is cancelled, the 
exception traceback now

--

___
Python tracker 
<https://bugs.python.org/issue46157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46157] Typo in JSON documentation

2021-12-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Kumar.

These errors were found with the following one-liners:

$ find -name '*.rst' -exec egrep --color -i '\ban 
+:[a-z:]+:`[qwrtpsdfghjklzxcvbnm]' '{}' +
$ find -name '*.rst' -exec egrep --color -i '\ba +:[a-z:]+:`[eyuioa]' '{}' +

They produce a lot of false positive results because of signatures and 
different reading of initial "y" and "u" (and "o", but there are no such cases 
here).

--

___
Python tracker 
<https://bugs.python.org/issue46157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46157] Typo in JSON documentation

2021-12-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

And more errors can be found with:

$ find -name '*.rst' -exec egrep --color -i '\ban +[qwrtpsdfghjklzxcvbnm]' '{}' 
+
$ find -name '*.rst' -exec egrep --color -i '\ba +[eioa]' '{}' +

It is worth to check also:

$ find -name '*.rst' -exec egrep --color -i '\ban +[yu]' '{}' +
$ find -name '*.rst' -exec egrep --color -i '\ba +[yu]' '{}' +

Most of them should be correct, but there may be some new errors.

--

___
Python tracker 
<https://bugs.python.org/issue46157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46157] Typo in JSON documentation

2021-12-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions: +Python 3.10, Python 3.11, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46157] Typo in JSON documentation

2021-12-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 30237 introduced few new errors.

--

___
Python tracker 
<https://bugs.python.org/issue46157>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46167] Parse assert (x == y, "Descriptive text") as statement params instead of a tuple

2021-12-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It does not need any change in parser, it can be done in the code generator 
which currently explicitly warns about such ambiguity.

Although it needs changes in formal grammar which will be more complex.

But what is a benefit? What is an advantage of writing

   assert (thing, description)

instead of

   assert thing, description

?

--
nosy: +gvanrossum, serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue46167>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46162] Make `builtins.property` generic

2021-12-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Does it mean that property[GetType, SetType] will be required and MyPy will 
complain if the raw property decorator be used?

--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue46162>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46167] Parse assert (x == y, "Descriptive text") as statement params instead of a tuple

2021-12-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

For very long expression or very long message you can add parentheses around 
the expression or message. Black will format it as:

assert (
very very long
expression
), (
"very very long "
"message"
)

With the proposed feature it will be:

assert (
very very long
expression,
"very very long "
"message",
)

It saves one line, but the border between an expression and a message is blur. 
Since they are separated by a comma at the end of line and all lines have the 
same indentation it looks less readable to me.

Note also that Black adds a comma after message.

--

___
Python tracker 
<https://bugs.python.org/issue46167>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-12-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 393ff040281db818f2d6e0240919316f58f989a6 by Miss Islington (bot) 
in branch '3.9':
bpo-45878: convert `try/except` to `self.assertRaises` in 
`Lib/ctypes/test/test_functions.py` (GH-29721) (GH-29723)
https://github.com/python/cpython/commit/393ff040281db818f2d6e0240919316f58f989a6


--

___
Python tracker 
<https://bugs.python.org/issue45878>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-12-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a9e0b2b49374df91c40fe409508cfcdc6332450e by Miss Islington (bot) 
in branch '3.10':
bpo-45878: convert `try/except` to `self.assertRaises` in 
`Lib/ctypes/test/test_functions.py` (GH-29721) (GH-29748)
https://github.com/python/cpython/commit/a9e0b2b49374df91c40fe409508cfcdc6332450e


--

___
Python tracker 
<https://bugs.python.org/issue45878>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45865] Old syntax in unittest

2021-12-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Not worth the hassle.

--

___
Python tracker 
<https://bugs.python.org/issue45865>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46175] Zero argument super() does not function properly inside generator expressions

2021-12-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue46175>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40296] help(list[int]) fails

2021-12-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +28474
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30253

___
Python tracker 
<https://bugs.python.org/issue40296>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46032] functools' singledispatch does not support GenericAlias

2021-12-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 078abb676cf759b1e960f78390b6e80f256f0255 by Serhiy Storchaka in 
branch 'main':
bpo-46032: Check types in singledispatch's register() at declaration time 
(GH-30050)
https://github.com/python/cpython/commit/078abb676cf759b1e960f78390b6e80f256f0255


--

___
Python tracker 
<https://bugs.python.org/issue46032>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46032] functools' singledispatch does not support GenericAlias

2021-12-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +28475
pull_request: https://github.com/python/cpython/pull/30254

___
Python tracker 
<https://bugs.python.org/issue46032>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46032] functools' singledispatch does not support GenericAlias

2021-12-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 03c7449fbc7c57f5e0365f234a0b65c1dde763f2 by Serhiy Storchaka in 
branch '3.10':
[3.10] bpo-46032: Check types in singledispatch's register() at declaration 
time (GH-30050) (GH-30254)
https://github.com/python/cpython/commit/03c7449fbc7c57f5e0365f234a0b65c1dde763f2


--

___
Python tracker 
<https://bugs.python.org/issue46032>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-12-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +28479
pull_request: https://github.com/python/cpython/pull/30258

___
Python tracker 
<https://bugs.python.org/issue45878>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-12-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +28480
pull_request: https://github.com/python/cpython/pull/30259

___
Python tracker 
<https://bugs.python.org/issue45878>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 11909c12c75a7f377460561abc97707a4006fc07 by Serhiy Storchaka in 
branch '3.10':
[3.10] Remove a NEWS entry for bpo-45878 (GH-30258)
https://github.com/python/cpython/commit/11909c12c75a7f377460561abc97707a4006fc07


--

___
Python tracker 
<https://bugs.python.org/issue45878>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 1fb7c61ca76c6fbff4d90b272e34e92bc2c7d729 by Serhiy Storchaka in 
branch 'main':
Remove a NEWS entry for bpo-45878 (GH-30259)
https://github.com/python/cpython/commit/1fb7c61ca76c6fbff4d90b272e34e92bc2c7d729


--

___
Python tracker 
<https://bugs.python.org/issue45878>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23819] test_asyncio fails when run under -O

2021-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a23ab7b6d8b3ae3a47747c0c4bceb2370cc48dcc by Kumar Aditya in 
branch 'main':
bpo-23819: Fix asyncio tests on python optimized mode (GH-30195)
https://github.com/python/cpython/commit/a23ab7b6d8b3ae3a47747c0c4bceb2370cc48dcc


--

___
Python tracker 
<https://bugs.python.org/issue23819>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45321] Module xml.parsers.expat.errors misses error code constants of libexpat >=2.0

2021-12-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +eli.bendersky, scoder

___
Python tracker 
<https://bugs.python.org/issue45321>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22815] unexpected successes are not output

2021-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 1944434b44e0118e812bf63f47b268ff6dd0c8f1 by Serhiy Storchaka in 
branch 'main':
bpo-22815: Print unexpected successes in summary in TextTestResult (GH-30138)
https://github.com/python/cpython/commit/1944434b44e0118e812bf63f47b268ff6dd0c8f1


--

___
Python tracker 
<https://bugs.python.org/issue22815>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22815] unexpected successes are not output

2021-12-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue22815>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset bee660e46ae2a051400177dcd758d95b5b4a6fcc by Miss Islington (bot) 
in branch '3.9':
[3.9] Remove a NEWS entry for bpo-45878 (GH-30258) (GH-30260)
https://github.com/python/cpython/commit/bee660e46ae2a051400177dcd758d95b5b4a6fcc


--

___
Python tracker 
<https://bugs.python.org/issue45878>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43413] tuple subclasses allow arbitrary kwargs

2021-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ad4857884b4821fc2c9bd23b63d03f9570eb03d1 by Serhiy Storchaka in 
branch 'main':
bpo-43413: Revert changes in set.__init__ (GH-28403)
https://github.com/python/cpython/commit/ad4857884b4821fc2c9bd23b63d03f9570eb03d1


--

___
Python tracker 
<https://bugs.python.org/issue43413>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45496] Tkinter: test_winfo_rgb failure

2021-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2e3e0d23adca8d83722d939d6abd1e467d7578f7 by E-Paine in branch 
'main':
bpo-45496: Allow flexibility in winfo_rgb tests (GH-30185)
https://github.com/python/cpython/commit/2e3e0d23adca8d83722d939d6abd1e467d7578f7


--

___
Python tracker 
<https://bugs.python.org/issue45496>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23819] test_asyncio fails when run under -O

2021-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 07229054a129a72b4ffdf29252eb73c6154c0ccf by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-23819: Fix asyncio tests on python optimized mode (GH-30195) 
(GH-30265)
https://github.com/python/cpython/commit/07229054a129a72b4ffdf29252eb73c6154c0ccf


--

___
Python tracker 
<https://bugs.python.org/issue23819>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46032] functools' singledispatch does not support GenericAlias

2021-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 25a12aac4de819745dfc64664ba183a5784b5a81 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-46032: Check types in singledispatch's register() at declaration time 
(GH-30050) (GH-30254) (GH-30255)
https://github.com/python/cpython/commit/25a12aac4de819745dfc64664ba183a5784b5a81


--

___
Python tracker 
<https://bugs.python.org/issue46032>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46032] functools' singledispatch does not support GenericAlias

2021-12-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46032>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45496] Tkinter: test_winfo_rgb failure

2021-12-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue45496>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45496] Tkinter: test_winfo_rgb failure

2021-12-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed

___
Python tracker 
<https://bugs.python.org/issue45496>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34963] String representation for types created with typing.NewType(…) are opaque and unappealing

2021-12-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue34963>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46175] Zero argument super() does not function properly inside generator expressions

2021-12-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I concur with Josh. super() uses a lot of magic, and in case of comprehensions 
it fails in interesting way.

Most common cases in which super() does not work:

1. Outside of a function defined in a class.
2. In a static method.
3. In inner function.
4. In comprehensions and generator expressions.

Idea #2 could help in cases 3 and 4.

--

___
Python tracker 
<https://bugs.python.org/issue46175>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars

2021-12-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Well, the tar command strips trailing slashes (even from file paths), so it is 
reasonable to do this in getmember().

$ mkdir dir
$ touch dir/file
$ tar cf archive.tar dir
$ tar tf archive.tar dir
dir/
dir/file
$ tar tf archive.tar dir/
dir/
dir/file
$ tar tf archive.tar dir/file
dir/file
$ tar tf archive.tar dir/file/
dir/file
$ tar tf archive.tar dir/file
dir/file

--

___
Python tracker 
<https://bugs.python.org/issue21987>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46191] Conflict between using annotations in singledispatch() and MyPy

2021-12-29 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

You can dispatch on collections.abc.Sequence.

@functools.singledispatch
def f(a: collections.abc.Sequence) -> None:
pass

But MyPy complains about this:

error: Missing type parameters for generic type "Sequence"

MyPy requires parametrized generic (like collections.abc.Sequence[int]), but 
singledispatch() does not work with it.

--
components: Library (Lib)
messages: 409295
nosy: gvanrossum, kj, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Conflict between using annotations in singledispatch() and MyPy
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46191>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2021-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The original issue is about dispatching on non-parametrized generics like 
typing.Sequence. isinstance([], typing.Sequence) works, so it could be possible 
to support dispatching on typing.Sequence. But I have doubts that it is worth 
to revive such feature, because it needs some effort, and you can use 
collections.abc.Sequence instead.

But there is a conflict between using annotations in singledispatch() and MyPy 
(issue46191).

--

___
Python tracker 
<https://bugs.python.org/issue34498>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

2021-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It was assigned to a variable initially because it was used in multiple places. 
Now it is only used in one place, but I agree with keeping the variable for 
readability.

But it should be named _IGNORED_ERRNOS.

--

___
Python tracker 
<https://bugs.python.org/issue45853>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46191] Conflict between using annotations in singledispatch() and MyPy

2021-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I do not think there is a problem in MyPy. What if use __origin__ for 
dispatching? Registering with parametrized generics with the same __origin__ 
will be error.

@sigledispatch
def f(a: int) -> None:
pass

@f.register  # ok
def _(a: list[int]) -> None:
pass

@f.register  # runtime error
def _(a: list[str]) -> None:
pass

@f.register  # runtime error
def _(a: list) -> None:
pass

f(1)  # ok
f([1])  # ok
f([])  # ok
f(['abc'])  # static type checking error

I think that it will have advantage of stronger static type checking.

--

___
Python tracker 
<https://bugs.python.org/issue46191>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   4   5   6   7   8   9   10   >