[issue45578] Missing tests for the dis module

2021-12-11 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28278 pull_request: https://github.com/python/cpython/pull/30058 ___ Python tracker <https://bugs.python.org/issue45

[issue46005] [doc] replace 'distutils' examples with 'setuptools'

2021-12-11 Thread Nikita Sobolev
Nikita Sobolev added the comment: Or maybe we should just include https://github.com/python/cpython/blob/main/Doc/distutils/_setuptools_disclaimer.rst as others do? I will send my proposal :) -- nosy: +sobolevn ___ Python tracker <ht

[issue46005] [doc] replace 'distutils' examples with 'setuptools'

2021-12-11 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28282 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30062 ___ Python tracker <https://bugs.python.org/issu

[issue46073] ast.unparse produces: 'FunctionDef' object has no attribute 'lineno' for valid module

2021-12-14 Thread Nikita Sobolev
Nikita Sobolev added the comment: Looks like this little patch can solve this problem: ``` def unparse(ast_obj): unparser = _Unparser() ---return unparser.visit(ast_obj) +++return unparser.visit(fix_missing_locations(ast_obj)) ``` But, I am not sure we should call this

[issue46073] ast.unparse produces: 'FunctionDef' object has no attribute 'lineno' for valid module

2021-12-14 Thread Nikita Sobolev
Nikita Sobolev added the comment: Moreover, there's always an option to pass `lineno` and `column` explicitly: ``` from ast import * # if we build the module manually and try it directly value = Module( body=[ FunctionDef( name="items_needed",

[issue46073] ast.unparse produces: 'FunctionDef' object has no attribute 'lineno' for valid module

2021-12-14 Thread Nikita Sobolev
Nikita Sobolev added the comment: Or, maybe this is a correct thing to do. Consider this case. Let's say we now check that `node` has `lineno` and exclude ones that don't. Then, we write this test (in `Lib/test/test_unparse`): ``` def test_unparse_nodes_without_l

[issue46120] Add note to `typing.Union` that it is recommended to use `|` instead

2021-12-18 Thread Nikita Sobolev
New submission from Nikita Sobolev : As discussed in https://mail.python.org/archives/list/typing-...@python.org/thread/TW5M6XDN7DO346RXMADKBAAGNSZPC4ZQ/ > we could probably stick a huge notice in the typing.Union docs saying `|` is > preferred for readability in most cases, a

[issue46120] Add note to `typing.Union` that it is recommended to use `|` instead

2021-12-18 Thread Nikita Sobolev
Change by Nikita Sobolev : -- nosy: +asvetlov, kj ___ Python tracker <https://bugs.python.org/issue46120> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46120] Add note to `typing.Union` that it is recommended to use `|` instead

2021-12-21 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28443 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30222 ___ Python tracker <https://bugs.python.org/issu

[issue46162] Make `builtins.property` generic

2021-12-23 Thread Nikita Sobolev
New submission from Nikita Sobolev : Original discussion in `typing` bug tracker: https://github.com/python/typing/issues/985 Short description: - `property[GetType, SetType]` is required for us to remove a lot of special casing from type-checkers and just use the primitive type - In runtime

[issue46162] Make `builtins.property` generic

2021-12-23 Thread Nikita Sobolev
Nikita Sobolev added the comment: One more question about PEP585: it does not specify `property`. Do we need to update it? -- ___ Python tracker <https://bugs.python.org/issue46

[issue46162] Make `builtins.property` generic

2021-12-23 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28460 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30238 ___ Python tracker <https://bugs.python.org/issu

[issue46150] test_pathlib assumes "fakeuser" does not exist as user

2021-12-23 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch nosy: +sobolevn nosy_count: 1.0 -> 2.0 pull_requests: +28462 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30240 ___ Python tracker <https://bugs.python.org/i

[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-23 Thread Nikita Sobolev
Nikita Sobolev added the comment: Hm, looks like `.name` does not exist for `MacOSXOSAScript`: ``` Python 3.11.0a3+ (heads/main-dirty:71ef0b4c2b, Dec 23 2021, 12:38:09) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or

[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-23 Thread Nikita Sobolev
Change by Nikita Sobolev : -- pull_requests: +28463 pull_request: https://github.com/python/cpython/pull/30241 ___ Python tracker <https://bugs.python.org/issue43

[issue46162] Make `builtins.property` generic

2021-12-23 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thanks, Guido! > Yes, it is too late for 3.10 (but you can add it to typing_extensions). Also, > PEP 585 is done, we don't update PEPs. Got it! > Please do test with `from __future__ import annotations` -- you never know. Done, PR is update

[issue46162] Make `builtins.property` generic

2021-12-24 Thread Nikita Sobolev
Nikita Sobolev added the comment: Serhiy, no, we can infer that. There are two general cases: 1. `x = property(x_get, x_set)`, it is just ideal 2. `@property x` and `@x.setter`, it is also inferable with a bit of special casing for the mutable type part (we mutate the type of `x` when

[issue46170] Improving the error message when subclassing NewType

2021-12-26 Thread Nikita Sobolev
Nikita Sobolev added the comment: This seems like a good idea to me. I will send a PR for others to judge :) -- nosy: +sobolevn ___ Python tracker <https://bugs.python.org/issue46

[issue46178] Remove `.travis.yml`?

2021-12-26 Thread Nikita Sobolev
New submission from Nikita Sobolev : Travis does not seem to be used anymore. There are not builds in Travis for cpython on `.org`: https://travis-ci.org/github/python/cpython/builds The last build on `.com` is 6 month old: https://app.travis-ci.com/github/python/cpython/builds If some

[issue46178] Remove `.travis.yml`?

2021-12-26 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28478 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30257 ___ Python tracker <https://bugs.python.org/issu

[issue46178] Remove `.travis.yml`?

2021-12-26 Thread Nikita Sobolev
Nikita Sobolev added the comment: Permanent link to the last version of this file: https://github.com/python/cpython/blob/078abb676cf759b1e960f78390b6e80f256f0255/.travis.yml -- ___ Python tracker <https://bugs.python.org/issue46

[issue46170] Improving the error message when subclassing NewType

2021-12-26 Thread Nikita Sobolev
Nikita Sobolev added the comment: > I'd be happy to patch this myself if this sounds like a good idea. Oh, please, go ahead! :) Would be happy to review. -- ___ Python tracker <https://bugs.python.org

[issue46170] Improving the error message when subclassing NewType

2021-12-26 Thread Nikita Sobolev
Nikita Sobolev added the comment: > So maybe those docs are incorrect? I can't find anything in PEP 484 about > this. Mypy even has an explicit test that NewType of NewType should work: https://github.com/python/mypy/blob/f96446ce2f99a86210b21d39c7aec4b13a8bfc66/test-data

[issue46170] Improving the error message when subclassing NewType

2021-12-26 Thread Nikita Sobolev
Nikita Sobolev added the comment: Turns out modern docs already have this problem fixed: https://docs.python.org/3/library/typing.html#newtype -- ___ Python tracker <https://bugs.python.org/issue46

[issue46184] Remove `netlify.toml`?

2021-12-26 Thread Nikita Sobolev
New submission from Nikita Sobolev : It was added one year ago in https://bugs.python.org/issue37860 But, it is not used. Right now it does not do anything. Others report that it has a lot of limitations (including financial and technical ones): https://github.com/python/cpython/pull/15288

[issue46184] Remove `netlify.toml`?

2021-12-26 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28487 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30272 ___ Python tracker <https://bugs.python.org/issu

[issue46120] Add note to `typing.Union` that it is recommended to use `|` instead

2021-12-29 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thank you for your time, Łukasz! -- ___ Python tracker <https://bugs.python.org/issue46120> ___ ___ Python-bugs-list mailin

[issue46198] Duplicated test name `test_get_unstructured_invalid_ew` in `test__header_value_parser.py`

2021-12-29 Thread Nikita Sobolev
New submission from Nikita Sobolev : There are two tests with the same name in a same test class in `Lib/test/test_email/test__header_value_parser.py`: `test_get_unstructured_invalid_ew` 1. https://github.com/python/cpython/blob/8e11237c5d24e649b26cc928b52bc37f2fde9c7a/Lib/test/test_email

[issue46198] Duplicated test name `test_get_unstructured_invalid_ew` in `test__header_value_parser.py`

2021-12-29 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28510 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30297 ___ Python tracker <https://bugs.python.org/issu

[issue46195] Annotated and Optional get_type_hints buggy interaction

2021-12-29 Thread Nikita Sobolev
Nikita Sobolev added the comment: I can verify that this happens on `3.10` and `main` branches: ``` from typing import Annotated, Optional, get_type_hints class Foo: def __init__(self, x: Annotated[Optional[str], "d"] = None): ... class Foo2: x: Annotated[Optional[str], &

[issue46195] Annotated and Optional get_type_hints buggy interaction

2021-12-29 Thread Nikita Sobolev
Change by Nikita Sobolev : -- versions: +Python 3.10, Python 3.11 -Python 3.8 ___ Python tracker <https://bugs.python.org/issue46195> ___ ___ Python-bugs-list m

[issue46195] Annotated and Optional get_type_hints buggy interaction

2021-12-29 Thread Nikita Sobolev
Nikita Sobolev added the comment: And on 3.9 as well. -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue46195> ___ ___ Python-bugs-list m

[issue46195] Annotated and Optional get_type_hints buggy interaction

2021-12-30 Thread Nikita Sobolev
Nikita Sobolev added the comment: As Guido said, the root cause of this problem is because `None` default automatically adds `Optional` to the resulting type. Source: https://github.com/python/cpython/blob/8d7644fa64213207b8dc6f555cb8a02bfabeced2/Lib/typing.py#L1854-L1856 So, what happens

[issue46196] documentation for cmd library should include columnize() function

2021-12-30 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch nosy: +sobolevn nosy_count: 2.0 -> 3.0 pull_requests: +28516 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30303 ___ Python tracker <https://bugs.python.org/i

[issue46195] Annotated and Optional get_type_hints buggy interaction

2021-12-30 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28517 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30304 ___ Python tracker <https://bugs.python.org/issu

[issue46198] Duplicated test name `test_get_unstructured_invalid_ew` in `test__header_value_parser.py`

2021-12-31 Thread Nikita Sobolev
Nikita Sobolev added the comment: Eric, should I patch this as well in this issue? Or should I open a new one? Would be happy to fix it :) -- ___ Python tracker <https://bugs.python.org/issue46

[issue46198] Duplicate and unused code in tests

2022-01-01 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thanks! I will also attach all `flake8`'s output if someone is going to need it: ``` » flake8 --select=F811 Lib/test Lib/test/test_descr.py:1165:13: F811 redefinition of unused 'C' from line 1158 Lib/test/test_descr.py:1172:13: F811 redefiniti

[issue46198] Duplicate and unused code in tests

2022-01-01 Thread Nikita Sobolev
Nikita Sobolev added the comment: > I think most of these are false positives Yes, they are! Please, check out my PR: https://github.com/python/cpython/pull/30297 сб, 1 янв. 2022 г. в 21:52, Éric Araujo : > > Éric Araujo added the comment: > > I think most of these are false

[issue46184] Remove `netlify.toml`?

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

[issue46178] Remove `.travis.yml`?

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

[issue46229] CODE_OF_CONDUCT shadowing org default

2022-01-02 Thread Nikita Sobolev
New submission from Nikita Sobolev : Problem: we have two CODE_OF_CONDUCT files. 1. In CPython: https://github.com/python/cpython/blob/main/CODE_OF_CONDUCT.md (last updated 3 years ago) 2. In Python org, default for all repos: https://github.com/python/.github/blob/master/CODE_OF_CONDUCT.md

[issue46229] CODE_OF_CONDUCT shadowing org default

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

[issue46238] Improve constants usage / definition in asyncio.windows_events

2022-01-03 Thread Nikita Sobolev
New submission from Nikita Sobolev : There are several problems in https://github.com/python/cpython/blob/549e62827262264cda30455e10e315602129da72/Lib/asyncio/windows_events.py#L31-L32 1. For some reason this module uses both `NULL` and `_winapi.NULL`, `INFINITE` and `_winapi.INFINITE

[issue46238] Improve constants usage / definition in asyncio.windows_events

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

[issue46239] Incosistent error message in asyncio: windows_events / windows_utils

2022-01-03 Thread Nikita Sobolev
New submission from Nikita Sobolev : When trying to import both `windows_events` and `windows_utils` on non-Windows, they both fail. But, they fail differently. `windows_utils` produces a good error message, whil `windows_events` produces a strange one. Good: ``` Python 3.11.0a3+ (heads

[issue46239] Incosistent error message in asyncio: windows_events / windows_utils

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

[issue46242] Improve error message when creating an enum with `__call__`

2022-01-03 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now when creating a new `Enum`, we check not to extend `Enum` with existing `_member_names_`: ```python Python 3.11.0a3+ (heads/main:8d7644fa64, Dec 30 2021, 13:00:40) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyr

[issue46242] Improve error message when creating an enum with `__call__`

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

[issue46262] Error path in `_missing_()` is not covered for `enum.Flag` and `enum.IntFlag`

2022-01-04 Thread Nikita Sobolev
New submission from Nikita Sobolev : I've noticed that `enum.Flag._missing_` has some uncovered paths. For example, this error is never checked: https://github.com/python/cpython/blob/31e43cbe5f01cdd5b5ab330ec3040920e8b61a91/Lib/enum.py#L1222-L1225 The same method for `Enum` has

[issue46262] Error path in `_missing_()` is not covered for `enum.Flag` and `enum.IntFlag`

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

[issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`

2022-01-05 Thread Nikita Sobolev
New submission from Nikita Sobolev : For some reasons useful day constants (`MONDAY` ... `SUNDAY`) from `calendar` are not properly recognised. Several problems: 0. Not all code inside uses these constants 1. They are not tested. Only `.MONDAY` and `.SUNDAY` are tested to be present in

[issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`

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

[issue46268] Buildbot failure for buildbot/AMD64 FreeBSD Non-Debug / Shared 3.x

2022-01-05 Thread Nikita Sobolev
New submission from Nikita Sobolev : Log: ``` --- sharedmods --- LD_LIBRARY_PATH=/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build CC='cc -pthread' LDSHARED='cc -pthread -shared' OPT='-g -O0 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='&#x

[issue46268] Buildbot failure for buildbot/AMD64 FreeBSD Non-Debug / Shared 3.x

2022-01-05 Thread Nikita Sobolev
Nikita Sobolev added the comment: It also generates several warnings: ``` Python/pytime.c:297:10: warning: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion] Python/pytime.c:352:1

[issue46269] '__new__' is never shown in `dir(SomeEnum)`

2022-01-05 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now `__new__` is marked to be special-cased in `Enum.__dir__`. It is generally ignored: But, (I think that was the original idea), when `__new__` is overridden, it should be added to the output. But, this line is problematic: https://github.com

[issue46269] '__new__' is never shown in `dir(SomeEnum)`

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

[issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`

2022-01-05 Thread Nikita Sobolev
Nikita Sobolev added the comment: > I don't think these were intended to be public. Thanks for the feedback! The problem is they are documented here: https://docs.python.org/3/library/calendar.html#calendar.setfirstweekday Should we change the docs there to hide them as implem

[issue46291] [doc] First argument to raise can also be BaseException

2022-01-07 Thread Nikita Sobolev
Nikita Sobolev added the comment: I think that this is intentional: tutorial gives some very basic ideas about what can be raised. Giving the whole context (you can `raise` two kinds of errors: `Exception` and `BaseException`, but they are different, should be used in different cases, and

[issue46296] Unreachable condition: `if enum_class._member_type_ is object`

2022-01-07 Thread Nikita Sobolev
New submission from Nikita Sobolev : This condition can never be `True`: https://github.com/python/cpython/blob/b127e70a8a682fe869c22ce04c379bd85a00db67/Lib/enum.py#L222-L223 Why? Because: 1. It is executed only when `if not enum_class._use_args_:`: https://github.com/python/cpython/blob

[issue46296] Unreachable condition: `if enum_class._member_type_ is object`

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

[issue46296] Unreachable condition: `if enum_class._member_type_ is object`

2022-01-07 Thread Nikita Sobolev
Nikita Sobolev added the comment: Yes, this is just a missing test. Not a wrong condition! -- components: +Tests -Library (Lib) ___ Python tracker <https://bugs.python.org/issue46

[issue46299] Improve several exception handling practices in `test_descr.py`

2022-01-07 Thread Nikita Sobolev
New submission from Nikita Sobolev : There are several problems in `test_descr.py` that I've found: 1. In `test_dir` there's a test case that ensure that `TypeError` is raised in some case: https://github.com/python/cpython/blame/c9dc1f491e8edb0bc433cde73190a3015d226891/Lib/test/tes

[issue46299] Improve several exception handling practices in `test_descr.py`

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

[issue46301] One branch is not covered in `Enum._convert_`

2022-01-07 Thread Nikita Sobolev
New submission from Nikita Sobolev : This branch is never covered: https://github.com/python/cpython/blob/c9dc1f491e8edb0bc433cde73190a3015d226891/Lib/enum.py#L831 I will send a PR in a moment :) -- components: Tests messages: 410053 nosy: sobolevn priority: normal severity: normal

[issue46301] One branch is not covered in `Enum._convert_`

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

[issue46305] SyntaxError when using dict key in fstring

2022-01-08 Thread Nikita Sobolev
Nikita Sobolev added the comment: Can you please try this: ``` dict1 = { "key1": "test" } print(dict1["key1"]) print(f"key1 is {dict1['key1']}!") ``` The problem with your code is that `dict1["key1"]`

[issue46223] asyncio cause infinite loop during debug

2022-01-08 Thread Nikita Sobolev
Nikita Sobolev added the comment: Just to clarify. What do you mean by "When running code in debug mode"? Do you use some debugger like `pdb` or pycharm? -- nosy: +sobolevn ___ Python tracker <https://bugs.python.o

[issue46306] Suspicios operation in `doctest.py`: `None - 1`

2022-01-08 Thread Nikita Sobolev
New submission from Nikita Sobolev : This line `lineno = getattr(obj, 'co_firstlineno', None)-1` does not look good. Link: https://github.com/python/cpython/blame/45d44b950f1dab0ef90d0a8f4fa75ffaae71500b/Lib/doctest.py#L1116 Why? 1. `CodeType` is guaranteed to have `co_firstlin

[issue46306] Suspicios operation in `doctest.py`: `None - 1`

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

[issue46310] Simplify `for` loop in `.close()` method in `asyncio/windows_events`

2022-01-09 Thread Nikita Sobolev
New submission from Nikita Sobolev : This line https://github.com/python/cpython/blob/3d11c1b8b49800c5c4c295953cc3abf577f6065a/Lib/asyncio/windows_events.py#L842 uses `.items()`, but the key seems unsused. It would be better to use `.values()` there. 1. It is slightly faster, very generic

[issue46310] Simplify `for` loop in `.close()` method in `asyncio/windows_events`

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

[issue28249] doctest.DocTestFinder reports incorrect line numbers with exclude_empty=False

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

[issue43698] Use syntactically correct examples on abc package page

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

[issue43698] Use syntactically correct examples on abc package page

2022-01-09 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thank you, I fully agree that this can be improved. Please, take a look at https://github.com/python/cpython/pull/30502 I will apprecaite your review! -- stage: patch review -> ___ Python tracker <

[issue46301] Enum tests: One branch is not covered in `Enum._convert_`

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

[issue46327] `test_enum` contains tests for older versions of python

2022-01-10 Thread Nikita Sobolev
New submission from Nikita Sobolev : Here's the problem: https://github.com/python/cpython/blob/main/Lib/test/test_enum.py#L4515-L4531 Why it is a problem? 1. First test is marked as `@unittest.skipUnless(python_version == (3, 8)`. Which means it is only executed on `3.8`. I think it s

[issue46327] `test_enum` contains tests for older versions of python

2022-01-10 Thread Nikita Sobolev
Nikita Sobolev added the comment: On the other hand second test ```python @unittest.skipUnless(python_version >= (3, 9), '_convert was removed in 3.9') def test_convert_raise(self): with self.assertRaises(AttributeError): enum.Int

[issue46327] `test_enum` contains tests for older versions of python

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

[issue46327] `test_enum` contains tests for older versions of python

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

[issue43681] doctest forgets previous imports

2022-01-10 Thread Nikita Sobolev
Nikita Sobolev added the comment: Ethan, I've tried to reproduce this, but it seems that example you attached is not valid. `Flag` is never imported at all. The same with `auto`. Should it be: ``` >>> from enum import auto, Flag, STRICT ``` the first time? As you said, it o

[issue45331] Can create enum of ranges, cannot create range enum. Range should be subclassable... or EnumMeta.__new__ should be smarter.

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

[issue46162] Make `builtins.property` generic

2022-01-11 Thread Nikita Sobolev
Nikita Sobolev added the comment: Looks like no one showed much interest in it :( So, yeah, closing it is probably the best idea. Thanks everyone! -- resolution: -> rejected stage: patch review -> resolved status: open -> closed _

[issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default

2022-01-11 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now this corner case is not tested: ```python class Some: x: int = None import typing assert typing.get_type_hints(Some) == {'x': int} ``` Notice that we don't add implicit `Optional` type to `x`. This is different for function

[issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default

2022-01-11 Thread Nikita Sobolev
Nikita Sobolev added the comment: I will send a PR today :) -- ___ Python tracker <https://bugs.python.org/issue46345> ___ ___ Python-bugs-list mailin

[issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default

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

[issue46348] Morernize `test_typing`

2022-01-11 Thread Nikita Sobolev
New submission from Nikita Sobolev : There are several very old details in `test_typing`. Some examples: 1. `@skipUnless(sys.version_info >= (3, 3), 'ChainMap was added in 3.3')` https://github.com/python/cpython/blame/dce642f24418c58e67fa31a686575c980c31dd37/Lib/test/test_ty

[issue46348] Morernize `test_typing`

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

[issue46348] Modernize `test_typing`

2022-01-11 Thread Nikita Sobolev
Nikita Sobolev added the comment: Alex, thanks a lot for fixing so many of my titles! Highly appreciated! -- components: +Tests -Library (Lib) ___ Python tracker <https://bugs.python.org/issue46

[issue46358] Modernize `test_asyncio/test_base_events.py`

2022-01-12 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now there's a special case for python3.4 in `Lib/test/test_asyncio/test_base_events.py` file. Links: - https://github.com/python/cpython/blob/0bbf30e2b910bc9c5899134ae9d73a8df968da35/Lib/test/test_asyncio/test_base_events.py#L24 -

[issue46359] Continue to modernize `test_typing.py`

2022-01-12 Thread Nikita Sobolev
New submission from Nikita Sobolev : This is a follow up to: - https://bugs.python.org/issue46348 - https://github.com/python/cpython/pull/30547 There are several other cases I've missed: 1. There's a test that is only executed under `<3.6`. I think that it should be re

[issue46359] Continue to modernize `test_typing.py`

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

[issue46358] Modernize `test_asyncio/test_base_events.py`

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

[issue46359] Continue to modernize `test_typing.py`

2022-01-12 Thread Nikita Sobolev
Change by Nikita Sobolev : -- components: +Tests type: -> behavior versions: +Python 3.11 ___ Python tracker <https://bugs.python.org/issue46359> ___ ___ Py

[issue40838] inspect.getsourcefile documentation doesn't mention it can return None

2022-01-13 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch nosy: +sobolevn nosy_count: 3.0 -> 4.0 pull_requests: +28775 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30575 ___ Python tracker <https://bugs.python.org/i

[issue46359] Continue to modernize `test_typing.py`

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

[issue46369] get_type_hints does not evaluate ForwardRefs inside NewType

2022-01-14 Thread Nikita Sobolev
Nikita Sobolev added the comment: I think we should go with `1)` and `A`. Adding a special case for getting hints from `NewType` directly does seem inconsistent with other type-constructs. Do you want to fix this? :) Or I can work on it today if you wish

[issue46369] get_type_hints does not evaluate ForwardRefs inside NewType

2022-01-14 Thread Nikita Sobolev
Nikita Sobolev added the comment: Oh, I mean `1)` and `B` -- ___ Python tracker <https://bugs.python.org/issue46369> ___ ___ Python-bugs-list mailing list Unsub

[issue46269] '__new__' is never shown in `dir(SomeEnum)`

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

[issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default

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

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

2022-01-14 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now there are two tests in Lib/test/test_functools.py that use `functools.lru_cache` directly: 1. https://github.com/python/cpython/blame/73140de97cbeb01bb6c9af1da89ecb9355921e91/Lib/test/test_functools.py#L1417 2. https://github.com/python/cpython

  1   2   3   4   >