Change by Nikita Sobolev :
--
pull_requests: +28278
pull_request: https://github.com/python/cpython/pull/30058
___
Python tracker
<https://bugs.python.org/issue45
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
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
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
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",
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
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
Change by Nikita Sobolev :
--
nosy: +asvetlov, kj
___
Python tracker
<https://bugs.python.org/issue46120>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
Change by Nikita Sobolev :
--
pull_requests: +28463
pull_request: https://github.com/python/cpython/pull/30241
___
Python tracker
<https://bugs.python.org/issue43
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
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
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
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
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
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
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
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
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
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
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
Nikita Sobolev added the comment:
Thank you for your time, Łukasz!
--
___
Python tracker
<https://bugs.python.org/issue46120>
___
___
Python-bugs-list mailin
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
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
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], &
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
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
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
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
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
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
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
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
Change by Nikita Sobolev :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Nikita Sobolev added the comment:
Thanks everyone!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
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
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
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
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
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
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
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
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
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
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
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='
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
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
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
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
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
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
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
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
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
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
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
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
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"]`
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
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
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
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
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
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
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
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
<
Change by Nikita Sobolev :
--
pull_requests: +28714
pull_request: https://github.com/python/cpython/pull/30510
___
Python tracker
<https://bugs.python.org/issue46
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
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
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
Change by Nikita Sobolev :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
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
_
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
Nikita Sobolev added the comment:
I will send a PR today :)
--
___
Python tracker
<https://bugs.python.org/issue46345>
___
___
Python-bugs-list mailin
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
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
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
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
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
-
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
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
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
Change by Nikita Sobolev :
--
components: +Tests
type: -> behavior
versions: +Python 3.11
___
Python tracker
<https://bugs.python.org/issue46359>
___
___
Py
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
Change by Nikita Sobolev :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
Nikita Sobolev added the comment:
Oh, I mean `1)` and `B`
--
___
Python tracker
<https://bugs.python.org/issue46369>
___
___
Python-bugs-list mailing list
Unsub
Change by Nikita Sobolev :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Nikita Sobolev :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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 - 100 of 365 matches
Mail list logo