[issue46380] `test_functools.TestLRU` must not use `functools` module directly

2022-01-14 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28806 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30606 ___ Python tracker <https://bugs.python.org/issu

[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-01-15 Thread Nikita Sobolev
Nikita Sobolev added the comment: Arie, can you please explain what is the technical difference between these two cases: ```python class A: __slots__ = ('a', ) # fields class B(A): __slots__ = ('a', 'b') # fields ``` And: ```pytho

[issue46386] Improve `test_typing::test_immutability_by_copy_and_pickle`

2022-01-15 Thread Nikita Sobolev
New submission from Nikita Sobolev : There are several problems with this test: https://github.com/python/cpython/blob/d02c5e9b55a8651b7d396ac3f2bdedf1fc1780b5/Lib/test/test_typing.py#L2130 1. It does not test all `pickle` protocols 2. It does not test newly added `ParamSpec` (probably others

[issue46386] Improve `test_typing::test_immutability_by_copy_and_pickle`

2022-01-15 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28816 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30613 ___ Python tracker <https://bugs.python.org/issu

[issue46387] `test_field_descriptor` in `test_collections` should test all pickle protocols

2022-01-15 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now this test does not test all pickle protocols: https://github.com/python/cpython/blob/d02c5e9b55a8651b7d396ac3f2bdedf1fc1780b5/Lib/test/test_collections.py#L680-L682 But, I guess that it should, like all other tests do. PR is on its way

[issue46387] `test_field_descriptor` in `test_collections` should test all pickle protocols

2022-01-15 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28817 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30614 ___ Python tracker <https://bugs.python.org/issu

[issue46386] Improve `test_typing::test_immutability_by_copy_and_pickle`

2022-01-15 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thank you, Jelle. Will send a PR to typing_extensions today as well :) -- ___ Python tracker <https://bugs.python.org/issue46

[issue46395] `Concatenate` is not covered to be a return type in `test_typing`

2022-01-16 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now all `Concatenate` tests do not cover `Callable[..., Concatenate]` case. Link: https://github.com/python/cpython/blob/09087b8519316608b85131ee7455b664c00c38d2/Lib/test/test_typing.py#L4862-L4877 I think, that this should be improved. It is an

[issue46395] `Concatenate` is not covered to be a return type in `test_typing`

2022-01-16 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28822 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30618 ___ Python tracker <https://bugs.python.org/issu

[issue46396] Invalid usage of `Concatenate` is not covered at all

2022-01-16 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now if I remove these lines: ```python if parameters == (): raise TypeError("Cannot take a Concatenate of no types.") if not isinstance(parameters, tuple): parameters = (parameters,) if not isinstance(par

[issue46396] Invalid usage of `Concatenate` is not covered at all

2022-01-16 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28823 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30619 ___ Python tracker <https://bugs.python.org/issu

[issue46395] `Concatenate` is not covered to be a return type in `test_typing`

2022-01-16 Thread Nikita Sobolev
Nikita Sobolev added the comment: > Sorry I'm confused: Callable[..., Concatenate] is invalid usage. So I don't > think we need to test it. Yes, my bad :) In this case, do we need to make this a `TypeError`? Right now you can use `Concatenate` as

[issue46395] `Concatenate` is not covered to be a return type in `test_typing`

2022-01-16 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thank you for the explanation, Ken Jin. Going to close this issue as invalid. -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bug

[issue46413] `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing`

2022-01-17 Thread Nikita Sobolev
New submission from Nikita Sobolev : Today I've noticed that these two methods are not covered: https://github.com/python/cpython/blame/16901c0482734dbd389b09ca3edfcf3e22faeed7/Lib/typing.py#L1028-L1032 - `typing._GenericAlias.__or__` - `typing._GenericAlias.__ror__` Later, I'v

[issue46413] `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing`

2022-01-17 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28843 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30640 ___ Python tracker <https://bugs.python.org/issu

[issue46416] Direct invocation of `Lib/test/test_typing.py` fails

2022-01-17 Thread Nikita Sobolev
New submission from Nikita Sobolev : Here's the problem: ``` » ./python.exe Lib/test/test_typi

[issue46416] Direct invocation of `Lib/test/test_typing.py` fails

2022-01-17 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28844 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30641 ___ Python tracker <https://bugs.python.org/issu

[issue46414] Add typing.reveal_type

2022-01-17 Thread Nikita Sobolev
Change by Nikita Sobolev : -- nosy: +sobolevn ___ Python tracker <https://bugs.python.org/issue46414> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46418] Simplify `MODULE` variable in `test_enum.py`

2022-01-17 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now `MODULE` in Lib/test/test_enum.py is defined as: ```python MODULE = ('test.test_enum', '__main__')[__name__=='__main__'] ``` I dived into history and did not find any reasoning why it should not be just `__name__

[issue46418] Simplify `MODULE` variable in `test_enum.py`

2022-01-17 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28849 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30647 ___ Python tracker <https://bugs.python.org/issu

[issue46418] Simplify `MODULE` variable in `test_enum.py`

2022-01-17 Thread Nikita Sobolev
Change by Nikita Sobolev : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46422] Why do we need `dis.Positions`?

2022-01-18 Thread Nikita Sobolev
New submission from Nikita Sobolev : While working on https://github.com/python/cpython/pull/30058 I've noticed that `Positions` namedtuple is kinda strange, source: https://github.com/python/cpython/blame/8c2fd09f365e082cfceb29afdf38953cdd670946/Lib/dis.py#L204-L213 Why? 1. It is not

[issue43950] Include column offsets for bytecode instructions

2022-01-18 Thread Nikita Sobolev
Nikita Sobolev added the comment: I've opened a new issue about unused `dis.Positions` here: https://bugs.python.org/issue46422 -- nosy: +sobolevn ___ Python tracker <https://bugs.python.org/is

[issue46424] `typing.Annotated` one type argument usage is not covered in tests

2022-01-18 Thread Nikita Sobolev
New submission from Nikita Sobolev : This condition is not covered: https://github.com/python/cpython/blob/bdf2ab1887a2edfb089a3c2a1590cf1e84ea0048/Lib/typing.py#L1674-L1677 I propose to add a test for it, because `Annotated[int]` is invalid. PR is on its way :) -- components: Tests

[issue46424] `typing.Annotated` one type argument usage is not covered in tests

2022-01-18 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28864 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30663 ___ Python tracker <https://bugs.python.org/issu

[issue46424] `typing.Annotated` one type argument usage is not covered in tests

2022-01-18 Thread Nikita Sobolev
Change by Nikita Sobolev : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-18 Thread Nikita Sobolev
New submission from Nikita Sobolev : While working on a similar issue for `test_typing.py` (https://bugs.python.org/issue46416) I wondered: how many other modules also have this problem? So, after several hours of local testing, I got several problems: - Lib/test/test_compileall.py Uses

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-18 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28866 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30666 ___ Python tracker <https://bugs.python.org/issu

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-18 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thank you, Ethan. Good idea! Will do from the second PR. Thanks for merging, Serhiy. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-18 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28876 pull_request: https://github.com/python/cpython/pull/30676 ___ Python tracker <https://bugs.python.org/issue46

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-18 Thread Nikita Sobolev
Nikita Sobolev added the comment: Terry, yes I am using this script to run tests locally: ```bash #!/usr/bin/env bash set -e while read line; do ./python.exe "$line" done < files.txt ``` And this one to populate `files.txt`: ```bash find ./Lib -iname 'test*.py

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-18 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28880 pull_request: https://github.com/python/cpython/pull/30681 ___ Python tracker <https://bugs.python.org/issue46

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-18 Thread Nikita Sobolev
Nikita Sobolev added the comment: Important note, in practice there's also a difference in how one calls some test module: - python Lib/test/test_contextlib.py - python ./Lib/test/test_contextlib.py Example of a test failure because of that: https://github.com/python/cpython/pull/

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-19 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28881 pull_request: https://github.com/python/cpython/pull/30682 ___ Python tracker <https://bugs.python.org/issue46

[issue46422] Why do we need `dis.Positions`?

2022-01-19 Thread Nikita Sobolev
Nikita Sobolev added the comment: Ok then, I will send my option `2` proposal to fix this later today. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46416] Direct invocation of `Lib/test/test_typing.py` fails

2022-01-19 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28895 pull_request: https://github.com/python/cpython/pull/30697 ___ Python tracker <https://bugs.python.org/issue46

[issue46416] Direct invocation of `Lib/test/test_typing.py` fails

2022-01-19 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28896 pull_request: https://github.com/python/cpython/pull/30698 ___ Python tracker <https://bugs.python.org/issue46

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-19 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28897 pull_request: https://github.com/python/cpython/pull/30699 ___ Python tracker <https://bugs.python.org/issue46

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-19 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28898 pull_request: https://github.com/python/cpython/pull/30700 ___ Python tracker <https://bugs.python.org/issue46

[issue46437] Non-required `hasattr` checks in `test_typing`

2022-01-19 Thread Nikita Sobolev
New submission from Nikita Sobolev : There are several legacy `hasattr` checks that are always `True` in newer Python versions: 1. https://github.com/python/cpython/blob/d45cd2d20770f72a000ba6dfa9ac88dd49423c27/Lib/test/test_typing.py#L3516 2. https://github.com/python/cpython/blob

[issue46437] Non-required `hasattr` checks in `test_typing`

2022-01-19 Thread Nikita Sobolev
Change by Nikita Sobolev : -- nosy: +kj ___ Python tracker <https://bugs.python.org/issue46437> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46437] Non-required `hasattr` checks in `test_typing`

2022-01-19 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28900 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30704 ___ Python tracker <https://bugs.python.org/issu

[issue46416] Direct invocation of `Lib/test/test_typing.py` fails

2022-01-19 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28903 pull_request: https://github.com/python/cpython/pull/30707 ___ Python tracker <https://bugs.python.org/issue46

[issue46422] Why do we need `dis.Positions`?

2022-01-19 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28908 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30716 ___ Python tracker <https://bugs.python.org/issu

[issue46445] Multiple inheritance of TypedDict is not covered in `test_typing`

2022-01-20 Thread Nikita Sobolev
New submission from Nikita Sobolev : Why is this important? 1. Because multiple inheritance of `TypedDict` might not handle `__required_keys__`, or `__optional_keys__`, or `__annotations__` correctly, this is especially important because some classes might be defined as `total=False` and

[issue46445] Multiple inheritance of TypedDict is not covered in `test_typing`

2022-01-20 Thread Nikita Sobolev
Change by Nikita Sobolev : -- nosy: +gvanrossum, kj ___ Python tracker <https://bugs.python.org/issue46445> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46445] Multiple inheritance of TypedDict is not covered in `test_typing`

2022-01-20 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28910 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30719 ___ Python tracker <https://bugs.python.org/issu

[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-20 Thread Nikita Sobolev
Change by Nikita Sobolev : -- nosy: +sobolevn ___ Python tracker <https://bugs.python.org/issue46442> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-20 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28915 pull_request: https://github.com/python/cpython/pull/30725 ___ Python tracker <https://bugs.python.org/issue46

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-21 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28933 pull_request: https://github.com/python/cpython/pull/30746 ___ Python tracker <https://bugs.python.org/issue46

[issue46460] Doc/library/dis.rst lists `versionchange` twice for `WITH_EXCEPT_START`

2022-01-21 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now it has two sections: ``` .. versionchanged:: 3.11 The ``__exit__`` function is in position 8 of the stack rather than 7. ``` And ``` .. versionchanged:: 3.11 The ``__exit__`` function is in position 4 of the stack rather than 7

[issue46460] Doc/library/dis.rst lists `versionchange` twice for `WITH_EXCEPT_START`

2022-01-21 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28939 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30752 ___ Python tracker <https://bugs.python.org/issu

[issue46396] Typing: test invalid usages of `Concatenate`

2022-01-22 Thread Nikita Sobolev
Nikita Sobolev added the comment: > So maybe that code could just be removed? I see this trend in typing.py :) I think it makes sense to make all new types (I still consider `ParamSpec` and `Concatenate` as new, desipte the fact they are already released in 3.10) as flexible as possi

[issue46396] Typing: test invalid usages of `Concatenate`

2022-01-22 Thread Nikita Sobolev
Nikita Sobolev added the comment: With this change `typing.py` and `typing_extensions.py` will have different logic: https://github.com/python/typing/blob/523cf0233edc7a29502fbd30dc6bf641a7408e16/typing_extensions/src/typing_extensions.py#L1805-L1811 Jelle, what should we do

[issue46445] Multiple inheritance of TypedDict is not covered in `test_typing`

2022-01-22 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thanks for the review and merge! :sparkle: -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46470] `_remove_dups_flatten` in `typing.py` contains dead branch

2022-01-22 Thread Nikita Sobolev
New submission from Nikita Sobolev : Here's how `_remove_dups_flatten` is defined right now: ``` def _remove_dups_flatten(parameters): """An internal helper for Union creation and substitution: flatten Unions among parameters, then remove duplicates. "&

[issue46470] `_remove_dups_flatten` in `typing.py` contains dead branch

2022-01-22 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28965 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30780 ___ Python tracker <https://bugs.python.org/issu

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-22 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28977 pull_request: https://github.com/python/cpython/pull/30792 ___ Python tracker <https://bugs.python.org/issue46

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-22 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28985 pull_request: https://github.com/python/cpython/pull/30800 ___ Python tracker <https://bugs.python.org/issue46

[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2022-01-22 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28986 pull_request: https://github.com/python/cpython/pull/30801 ___ Python tracker <https://bugs.python.org/issue41

[issue46409] Add a new bytecode instruction to create generators

2022-01-22 Thread Nikita Sobolev
Change by Nikita Sobolev : -- nosy: +sobolevn nosy_count: 1.0 -> 2.0 pull_requests: +28991 pull_request: https://github.com/python/cpython/pull/30780 ___ Python tracker <https://bugs.python.org/issu

[issue44642] Union of a type and the typing module function

2022-01-22 Thread Nikita Sobolev
Nikita Sobolev added the comment: It does not happen anymore on `main` (3.11): ``` Python 3.11.0a4+ (heads/main-dirty:ef3ef6fa43, Jan 20 2022, 20:48:25) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license"

[issue46475] Document use of NoReturn as a bottom type

2022-01-22 Thread Nikita Sobolev
Nikita Sobolev added the comment: I agree. Plus, I cannot refrain from saying that it is generally quite hard to teach what "NoReturn" is. I start by explaining what bottom type and `void` is and then just say that in Python it is called `NoReturn`. I remember that there was a

[issue44642] Union of a type and the typing module function

2022-01-22 Thread Nikita Sobolev
Nikita Sobolev added the comment: Looks like it was fixed indeed, `NewType` is now a class. And I cannot reproduce it even on `3.10`: ``` Python 3.10.0 (default, Nov 1 2021, 10:24:06) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credi

[issue46482] `typing.Annotation.__new__` is not covered

2022-01-22 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now no unit test covers this line: https://github.com/python/cpython/blob/51c3e28c8a163e58dc753765e3cc51d5a717e70d/Lib/typing.py#L1669-L1670 I will send a simple test for it. -- components: Tests messages: 411352 nosy: gvanrossum, kj

[issue46482] `typing.Annotation.__new__` is not covered

2022-01-22 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +29008 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30821 ___ Python tracker <https://bugs.python.org/issu

[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-01-23 Thread Nikita Sobolev
New submission from Nikita Sobolev : After reviewing https://github.com/python/cpython/pull/30777 I had a chance to look through other definitions of `def __class_getitem__`. And I found that the only one left is: `pathlib.PurePath.__class_getitem__` All other definitions already have this

[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-01-23 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +29009 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30822 ___ Python tracker <https://bugs.python.org/issu

[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-01-24 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +29030 pull_request: https://github.com/python/cpython/pull/30848 ___ Python tracker <https://bugs.python.org/issue46

[issue46422] Why do we need `dis.Positions`?

2022-01-24 Thread Nikita Sobolev
Change by Nikita Sobolev : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46396] `Concatenate` should not raise any semantic errors

2022-01-24 Thread Nikita Sobolev
Nikita Sobolev added the comment: PR is updated, now `Concatenate` does not raise any semantic errors: https://github.com/python/cpython/pull/30619 -- components: +Library (Lib) -Tests title: Typing: test invalid usages of `Concatenate` -> `Concatenate` should not raise any seman

[issue46416] Direct invocation of `Lib/test/test_typing.py` fails

2022-01-24 Thread Nikita Sobolev
Nikita Sobolev added the comment: During this work some people have mentioned that they actually use `'__main__'` for local debugging of tests. I don't think that I am familiar enough with the existing workflow to make any educated decision :) пн, 24 янв. 2022 г. в 19:34, C

[issue46396] `Concatenate` should not raise any semantic errors

2022-01-25 Thread Nikita Sobolev
Nikita Sobolev added the comment: I think that in case when we preserve the runtime checks, they should be covered by tests. Right now - they are not. So, I will switch my PR to the initial version with a new test case. Does this sound right

[issue46519] test_typing failing on branch 3.10

2022-01-25 Thread Nikita Sobolev
Nikita Sobolev added the comment: One of the first things to think of: maybe `NewTypeTests` are not executed at all on 3.10? -- ___ Python tracker <https://bugs.python.org/issue46

[issue46519] test_typing failing on branch 3.10

2022-01-25 Thread Nikita Sobolev
Nikita Sobolev added the comment: These lines seem suspicious: ``` 0:09:12 load avg: 6.37 Re-running failed tests in verbose mode 0:09:12 load avg: 6.37 Re-running test_typing in verbose mode (matching: setUpClass) 1 re-run test: test_typing 1 test run no tests: test_typing

[issue46523] Test suite skips failing tests

2022-01-25 Thread Nikita Sobolev
New submission from Nikita Sobolev : Here's what happened. We had an error in `test_typing.py`, which was silently ignored. ``` == ERROR: setUpClass (test.test_typing.NewType

[issue46519] test_typing failing on branch 3.10

2022-01-25 Thread Nikita Sobolev
Nikita Sobolev added the comment: I filled a new issue: https://bugs.python.org/issue46523 -- ___ Python tracker <https://bugs.python.org/issue46519> ___ ___

[issue46520] `ast.unparse` produces syntactically illegal code for identifiers that look like reserved words

2022-01-25 Thread Nikita Sobolev
Nikita Sobolev added the comment: I can confirm that it happens on all versions from 3.9 to 3.11 (main). ``` Python 3.9.9 (main, Dec 21 2021, 11:35:28) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license&qu

[issue46523] Test suite skips failing tests when setUp[Class] fails

2022-01-25 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +29076 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30895 ___ Python tracker <https://bugs.python.org/issu

[issue46529] Improve test coverage of `Union` and `Optional` repr()

2022-01-26 Thread Nikita Sobolev
New submission from Nikita Sobolev : There are several important cases that are missing from current `repr()` tests of `typing.Union` and `typing.Optional`: 1. This condition is not covered at all: `if args[0] is type(None):` https://github.com/python/cpython/blob

[issue46529] Improve test coverage of `Union` and `Optional` repr()

2022-01-26 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +29090 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30911 ___ Python tracker <https://bugs.python.org/issu

[issue24398] Update test_capi to use test.support.script_helper

2022-01-26 Thread Nikita Sobolev
Change by Nikita Sobolev : -- nosy: +sobolevn nosy_count: 2.0 -> 3.0 pull_requests: +29091 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30912 ___ Python tracker <https://bugs.python.org/i

[issue46530] `'thread_time'` is missing from `test_get_clock_info`

2022-01-26 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now here's how `test_get_clock_info` looks like: ``` def test_get_clock_info(self): clocks = ['monotonic', 'perf_counter', 'process_time', 'time'] for name in clocks

[issue46530] `'thread_time'` is missing from `test_get_clock_info`

2022-01-26 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +29092 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30913 ___ Python tracker <https://bugs.python.org/issu

[issue46531] Simplify exception handling in `doctest.py`

2022-01-26 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now there are two places where `sys.exc_info()` calls are not required anymore: 1. https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L1352-L1353 2. https://github.com/python/cpython/blob

[issue46531] Simplify exception handling in `doctest.py`

2022-01-26 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +29095 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30916 ___ Python tracker <https://bugs.python.org/issu

[issue46531] Simplify exception handling in `doctest.py`

2022-01-26 Thread Nikita Sobolev
Nikita Sobolev added the comment: Fair enough! The only improvement is that we don't call `sys.exc_info` twice here: https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L2641-L2644 But, I think it is a minor thing. Looks like I've mis

[issue46544] `textwrap.TextWrapper` leaks two intermediate vars into class namespace

2022-01-27 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now this works: ``` >>> import textwrap >>> textwrap.TextWrapper.x ' ' >>> textwrap.TextWrapper.uspace 32 ``` This happens because of these lines: https://github.com/python/cpython/blame/606e496dd6e2ace298532da

[issue46545] `textwrap.TextWrapper` leaks two intermediate vars into class namespace

2022-01-27 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now this works: ``` >>> import textwrap >>> textwrap.TextWrapper.x ' ' >>> textwrap.TextWrapper.uspace 32 ``` This happens because of these lines: https://github.com/python/cpython/blame/606e496dd6e2ace298532da

[issue46545] `textwrap.TextWrapper` leaks two intermediate vars into class namespace

2022-01-27 Thread Nikita Sobolev
Nikita Sobolev added the comment: Oups, somehow I created two identical issues. Closing this one. -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46544] `textwrap.TextWrapper` leaks two intermediate vars into class namespace

2022-01-27 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +29134 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30955 ___ Python tracker <https://bugs.python.org/issu

[issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable

2022-01-27 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now in `DeprecatedList` there's a possibly unwated name leak of `method_name` here: https://github.com/python/cpython/blob/08c0ed2d9c0d01ad1a5adc0787bc75e4e90cbb85/Lib/importlib/metadata/__init__.py#L295-L308 ``` for method_na

[issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable

2022-01-27 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +29135 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30956 ___ Python tracker <https://bugs.python.org/issu

[issue46547] `pydoc.Helper` leaks several `for` loop variables

2022-01-27 Thread Nikita Sobolev
New submission from Nikita Sobolev : Here's the problem. `pydoc.Helper` is defined as: ``` class Helper: for topic, symbols_ in _symbols_inverse.items(): for symbol in symbols_: topics = symbols.get(symbol, topic) if topic not in t

[issue46547] `pydoc.Helper` leaks several `for` loop variables

2022-01-27 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +29136 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30957 ___ Python tracker <https://bugs.python.org/issu

[issue46416] Direct invocation of `Lib/test/test_typing.py` fails

2022-01-27 Thread Nikita Sobolev
Change by Nikita Sobolev : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable

2022-01-27 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thanks, Jason! I've submitted https://github.com/python/importlib_metadata/pull/365 > What's the harm in leaving this attribute on a class that is itself standing > in for deprecated behavior and slated for removal? I think it does not d

[issue46550] __slots__ updates despite being read-only

2022-01-27 Thread Nikita Sobolev
Nikita Sobolev added the comment: It does not happen on `3.11` (main): ``` Python 3.11.0a4+ (heads/main-dirty:ef3ef6fa43, Jan 20 2022, 20:48:25) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more i

[issue46530] `'thread_time'` is missing from `test_get_clock_info`

2022-01-27 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thank you! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46565] Multiple modules leak `for` loop variables into module's namespace

2022-01-28 Thread Nikita Sobolev
New submission from Nikita Sobolev : Some variables created as `for X in ...` leak into module's namespace, where the loop is defined. I wrote a simple `flake8` plugin to find names that are used in `ast.Module` in `ast.For`, but not under `if __name__ == '__main__'` and are n

<    1   2   3   4   >