[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-07 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: Serhiy, for example `issubclass(typing.MutableMapping, typing.Mapping)` returns `True` while neither of those two are actual class objects. These relationships are kept mostly so that `typing.*` can be used as a drop-in repla

[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-15 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: Yes, this is because subclassing `typing.NamedTuple` is not an actual subclassing, but is just a syntactic sugar for calling `collections.namedtuple`. A discussion about allowing subclassing/extending named tuples previously ap

[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-15 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: I would say it is too late. `typing.NamedTuple` is out there for more than a year and is quite actively used. A search on GitHub shows thousands of files that import `typing.NamedTuple` and a macroscopic fraction of tho

[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-16 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: > Apart from the fact that it's too late, if you had to do it over again, could it be done as a class decorator? Yes, this could be done as a decorator which would replace the original class with a named tuple after i

[issue33018] Improve issubclass() error checking and message

2018-03-09 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: To be honest I am still undecided on this. In principle, I am OK with status quo, but I am also OK, with the PR that will prohibit non-classes. I am a bit worried that it may break some existing code, so it is probably not f

[issue33075] typing.NamedTuple does not deduce Optional[] from using None as default field value

2018-03-14 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: This is actually an intended behaviour. Moreover, the implicit optionality of arguments that default to `None` is deprecated and will be removed in one of the future versions. (Note that since typing module is still provi

[issue33075] typing.NamedTuple does not deduce Optional[] from using None as default field value

2018-03-14 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi <levkivs...@gmail.com>: -- resolution: -> not a bug stage: -> resolved ___ Python tracker <rep...@bugs.python.org> <https://bugs.

[issue33075] typing.NamedTuple does not deduce Optional[] from using None as default field value

2018-03-14 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi <levkivs...@gmail.com>: -- status: open -> closed ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32873] Pickling of typing types

2018-04-04 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: Apparently there is another type with a similar problem -- DefaultDict. Will fix this now. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32873] Pickling of typing types

2018-04-04 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: New changeset 2a363d2930e29ec6d8a774973ed5a4965f881f5f by Ivan Levkivskyi in branch 'master': bpo-32873: Remove a name hack for generic aliases in typing module (GH-6376) https://github.com/python/cpython/

[issue32873] Pickling of typing types

2018-04-04 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi <levkivs...@gmail.com>: -- pull_requests: +6088 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32873> ___

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-04-06 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi <levkivs...@gmail.com>: -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <https://bu

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-06 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: > I was hoping to see if this was seen as a reasonable patch that might be > accepted. I didn't look carefully but superficially it looks reasonable, so it is worth trying. > Also, while I think it would be nice, I

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-05 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi <levkivs...@gmail.com>: -- nosy: +levkivskyi ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33211> ___

[issue33207] typing.Generic does not correctly call super().__init_subclass__

2018-04-04 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi <levkivs...@gmail.com>: -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <https://bu

[issue33315] Allow queue.Queue to be used in type annotations

2018-04-22 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: I think this issue appeared previously on typing tracker. The current recommendation is to escape problematic annotations with quotes: q: 'Queue[int]' I don't think it will be added to typing, because following this way

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: This is not a bug but an explicit design decision. Generic classes are _static_ typing concept and therefore are not supposed to work freely with _dynamic_ class creation. During discussion of PEP 560 it was decided that there

[issue33190] problem with ABCMeta.__prepare__ when called after types.new_class

2018-03-30 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: https://devguide.python.org/ will help you. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: > If we're going to call new_class in make_dataclass, then we should change the > signature of make_dataclass to have the new_class parameters. Why? I think we should care about what API/signature is reasonable/typical for

[issue33133] Don't return implicit optional types by get_type_hints

2018-03-24 Thread Ivan Levkivskyi
New submission from Ivan Levkivskyi <levkivs...@gmail.com>: Currently this code def f(x: int = None): pass get_type_hints(f) returns {'x': Optional[int]}. I propose to abandon this behaviour. Although there is not yet a definitive decision about this aspect of PEP 484, see

[issue32873] Pickling of typing types

2018-03-24 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi <levkivs...@gmail.com>: -- keywords: +patch pull_requests: +5961 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue33133] Don't return implicit optional types by get_type_hints

2018-03-25 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: OK, let us then keep this issue as a remainder that we need to update the runtime behaviour when the static one changes. -- ___ Python tracker <rep...@bugs.python.or

[issue32162] typing.Generic breaks __init_subclass__

2018-04-02 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: Thanks Will! I think this is actually a different (although very similar issue). It looks like it is easy to fix. Could you please open a separate issue (and mention it here)? Also could you please provide a typical exampl

[issue33207] typing.Generic does not correctly call super().__init_subclass__

2018-04-02 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi <levkivs...@gmail.com>: -- keywords: +patch pull_requests: +6066 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue33190] problem with ABCMeta.__prepare__ when called after types.new_class

2018-03-30 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: This is not a bug, but a misunderstanding: * First, ABCMeta doesn't have `__prepare__`, it is just `type.__prepare__` * Second, the third argument to `types.new_class` is called `kwds` for a reason. It is not a namespace like in

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-31 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi <levkivs...@gmail.com>: -- keywords: +patch pull_requests: +6035 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32873] Pickling of typing types

2018-03-26 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi <levkivs...@gmail.com>: -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <https://bu

[issue32873] Pickling of typing types

2018-03-26 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: New changeset 834940375ae88bc95794226dd8eff1f25fba1cf9 by Ivan Levkivskyi in branch 'master': bpo-32873: Treat type variables and special typing forms as immutable by copy and pickle (GH-6216) https://github.com/python/cpython/

[issue33061] NoReturn missing from __all__ in typing.py

2018-03-16 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi <levkivs...@gmail.com>: -- nosy: +gvanrossum ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33061> ___

[issue33061] NoReturn missing from __all__ in typing.py

2018-03-16 Thread Ivan Levkivskyi
New submission from Ivan Levkivskyi <levkivs...@gmail.com>: This is clearly a bug. Would you like to make a PR? -- nosy: +levkivskyi ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue33061] NoReturn missing from __all__ in typing.py

2018-03-20 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: I think it makes sense to also fix this in 3.7. I will prepare a backport now. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue33061] NoReturn missing from __all__ in typing.py

2018-03-20 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi <levkivs...@gmail.com>: -- pull_requests: +5918 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33061> ___

[issue33018] Improve issubclass() error checking and message

2018-03-20 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: I am still -1 on changing this in Python 3.7, unless Guido wants this in 3.7, if yes, then we can go ahead. Otherwise, I think we can consider just merging this into master, in this case I would switch to the PR to discuss the d

[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-20 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: > Would it be worthwhile to show an example of a subclass that overrides or > extends __new__? I think yes. I would actually add few examples what could (and maybe also couldn't) be done with

[issue33018] Improve issubclass() error checking and message

2018-03-22 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: New changeset 40472dd42de4f7265d456458cd13ad6894d736db by Ivan Levkivskyi (jab) in branch 'master': bpo-33018: Improve issubclass() error checking and message. (GH-5944) https://github.com/python/cpython/

[issue33018] Improve issubclass() error checking and message

2018-03-22 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: New changeset 5d8bb5d07be2a9205e7059090f0ac5360d36b217 by Ivan Levkivskyi (Miss Islington (bot)) in branch '3.7': bpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189) (GH-6190) https://github.com/python/cpython/

[issue33018] Improve issubclass() error checking and message

2018-03-22 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: I am closing this for now. We can re-open it later if problems will appear in 3.7. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Pyth

[issue32505] dataclasses: make field() with no annotation an error

2018-03-22 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: > you'll notice that's an error? Yes, but there are other scenarios, like using `init=False` or updating existing class definition and forgetting to update call sites (which will still work), etc. What would we lose by not

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-22 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: New changeset 5d8bb5d07be2a9205e7059090f0ac5360d36b217 by Ivan Levkivskyi (Miss Islington (bot)) in branch '3.7': bpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189) (GH-6190) https://github.com/python/cpython/

[issue33061] NoReturn missing from __all__ in typing.py

2018-03-19 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: New changeset 4573820d2a9156346392838d455e89f33067e9dd by Ivan Levkivskyi (aetracht) in branch 'master': bpo-33061: Add missing 'NoReturn' to __all__ in typing.py (GH-6127) https://github.com/python/cpython/

[issue32505] dataclasses: make field() with no annotation an error

2018-03-21 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: Some part of the discussion is in https://bugs.python.org/issue32428 I still think it is important to flag things like this as an error: @dataclass class C: x = field() This is a big bug magnet. Especially taking into a

[issue33018] Improve issubclass() error checking and message

2018-03-21 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: > Would you merge this into master? OK, I played with this a bit and it looks good. There is however a merge conflict now, and a NEWS item is missing. I will leave a comment

[issue33061] NoReturn missing from __all__ in typing.py

2018-03-23 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: The typing repo PR is not merged yet, but I am closing this here, the remainder is tracked in typing repo. -- resolution: -> fixed stage: patch review -> resolved status: op

[issue33061] NoReturn missing from __all__ in typing.py

2018-03-23 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: New changeset ac5602746ed39ca6591e98e062e587121ac71371 by Ivan Levkivskyi in branch '3.7': bpo-33061: Add missing 'NoReturn' to __all__ in typing.py (GH-6127) (#6162) https://github.com/python/cpython/

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-06 Thread Ivan Levkivskyi
Ivan Levkivskyi <levkivs...@gmail.com> added the comment: Actually, the behaviour when __suclasscheck__ returns True for non-class objects may be used by some code. Even typing module did this, I tried to remove as much as possible of this, but I think there may be few such situation

[issue34939] Possibly spurious SyntaxError: annotated name can't be global

2018-10-11 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I think we can just go ahead and allow this. If there is a volunteer, please go ahead, otherwise I will try to find time for this myself. -- ___ Python tracker <https://bugs.python.org/issue34

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

2018-10-21 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: OK, so now we have two "competing" PRs. I think I like Serhiy's PR a bit more, since it is simpler. I would propose to look at benchmarks and then decide. Are there any other factors I am missing for choosing one or othe

[issue35089] Remove typing.io and typing.re from documentation

2018-10-28 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35089] Remove typing.io and typing.re from documentation

2018-10-28 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset c8a8d6b347d5a6899feb7c810d28f22f3cb151b8 by Ivan Levkivskyi (Sebastian Rittau) in branch 'master': bpo-35089: Don't mention typing.io and typing.re (GH-10173) https://github.com/python/cpython/commit/c8a8d6b347d5a6899feb7c810d28f22f3cb151b8

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

2018-10-28 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Serhiy, thanks for benchmarks and good suggestions! > If make NewType a class, I would make the repr looking like a call This is a nice idea, it indeed looks better. We can probably also use `_type_repr()` helper for the argument (for consiste

[issue35119] Customizing module attribute access example raises RecursionError

2018-10-31 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Yes, this is expected, you should use ``super().__setattr__()``. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35119] Customizing module attribute access example raises RecursionError

2018-11-04 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Ah, sorry, I didn't understand this was a documentation issue. Please feel free to submit a PR that fixes the example to use `super().__setattr__()`. -- resolution: not a bug -> stage: resolved -> needs patch status: closed -

[issue35143] Annotations future requires unparse, but not accessible from Python

2018-11-02 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker <https://bugs.python.org/issue35143> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface

2018-11-10 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: The separation may look arbitrary, but the idea is quite simple. Only those classes with few methods support structural checks. Those classes have few independent abstract methods (or even just one method), while in classes with large APIs like `Sequence

[issue35119] Customizing module attribute access example raises RecursionError

2018-11-05 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 0bee3c36d406e47fa9f99cfc1e07b701512c4f3f by Ivan Levkivskyi (Denis Osipov) in branch 'master': bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323) https://github.com/python/cpython/commit

[issue35119] Customizing module attribute access example raises RecursionError

2018-11-05 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: -miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34939] Possibly spurious SyntaxError: annotated name can't be global

2018-10-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Hm, I think this should be allowed. The formulation in the docs is not very clear, but the wording in the PEP clarifies the intention. Indeed, only annotations at the same scope with global declarations should be prohibited. So I think this is a bug

[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-08 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-08 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 5eea0ad50c32d38909ff4e29309e2cc3c6ccb2c0 by Ivan Levkivskyi (Noah Wood) in branch 'master': bpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750) https://github.com/python/cpython/commit/5eea0ad50c32d38909ff4e29309e2cc3c6ccb2c0

[issue34760] Regression in abc in combination with passing a function to issubclass

2018-09-21 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: This was a conscious decision (i.e we decided that the old inconsistency is a bug). See https://bugs.python.org/issue33018 for previous discussion. What is your use case? If it is critical, we can reconsider

[issue34700] typing.get_type_hints doesn't know about typeshed

2018-09-21 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I think there is also a fourth option: add a flag to `get_type_hints()` that will guard evaluation of forward references, as proposed in https://github.com/python/typing/issues/508. If the evaluation of a "forward reference" raises an error, th

[issue34760] Regression in abc in combination with passing a function to issubclass

2018-09-21 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: OK, lets close this for now. We will see if there are any other situations. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34700] typing.get_type_hints doesn't know about typeshed

2018-09-27 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- assignee: -> levkivskyi ___ Python tracker <https://bugs.python.org/issue34700> ___ ___ Python-bugs-list mailing list Un

[issue34776] Postponed annotations break inspection of dataclasses

2018-09-27 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker <https://bugs.python.org/issue34776> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability

2018-11-16 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker <https://bugs.python.org/issue35232> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33416] Add endline and endcolumn to every AST node

2019-01-18 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- keywords: +patch, patch pull_requests: +11329, 11330 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue33416] Add endline and endcolumn to every AST node

2019-01-18 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- keywords: +patch pull_requests: +11329 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33416> ___ _

[issue33416] Add endline and endcolumn to every AST node

2019-01-18 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- keywords: +patch, patch, patch pull_requests: +11329, 11330, 11331 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35766] Merge typed_ast back into CPython

2019-01-19 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker <https://bugs.python.org/issue35766> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33416] Add endline and endcolumn to every AST node

2019-01-22 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 9932a22897ef9905161dac7476e6976370e13515 by Ivan Levkivskyi in branch 'master': bpo-33416: Add end positions to Python AST (GH-11605) https://github.com/python/cpython/commit/9932a22897ef9905161dac7476e6976370e13515

[issue35540] dataclasses.asdict breaks with defaultdict fields

2018-12-22 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi __ Python tracker <https://bugs.python.org/issue35540> __ ___ Python-bugs-list mailing list Unsub

[issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface (doc issue)

2018-11-29 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I would propose to keep this one open as a superseding https://bugs.python.org/issue23864 and close the latter (assuming we are not going to make all classes protocols, we I think we really shouldn't, and instead we should improve the docs

[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 68b56d02ef20479b87c65e523cf3dec1b7b77d40 by Ivan Levkivskyi (Ismo Toijala) in branch 'master': bpo-35341: Add generic version of OrderedDict to typing (GH-10850) https://github.com/python/cpython/commit/68b56d02ef20479b87c65e523cf3dec1b7b77d40

[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35341] Add generic version of OrderedDict to typing module

2018-11-29 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Yes, since we already have `DefaultDict`, `Counter`, and `ChainMap` from collections, we can also add `OrderedDict`. -- ___ Python tracker <https://bugs.python.org/issue35

[issue35341] Add generic version of OrderedDict to typing module

2018-11-29 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Also typing is technically still provisional, we can backport this to previous versions (at least to 3.7). -- ___ Python tracker <https://bugs.python.org/issue35

[issue33416] Add endline and endcolumn to every AST node

2018-11-22 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: issue22616 is a bit different (proposing line/column ranges instead of just endline/endcolumn). I am happy to close this one in favor of issue22616 if we agree that we will go with endline/endcolumn. I can't guarantee, but likely I will work on this during

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-11-22 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__

2018-11-20 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I am with Inada-san actually. I would go as far as saying that @cached_property @abstractmethod def something(): ... should unconditionally raise on definition. Mostly because this is just misleading. This declaration doesn't guarantee

[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-11-28 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset f71a5922916abd6cc7bf7d99ed4715b6e96e5981 by Ivan Levkivskyi (Ismo Toijala) in branch '3.7': bpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750) (GH-10772) https://github.com/python/cpython/commit

[issue35631] Improve typing docs wrt abstract/concrete collection types

2019-01-04 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I think this can be closed now. Whether to merge doc-fix backport to now security-only 3.6 branch is up to Ned. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Pytho

[issue35631] Improve typing docs wrt abstract/concrete collection types

2019-01-04 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 31ec52a9afedd77e36a3ddc31c4c45664b8ac410 by Ivan Levkivskyi (Ville Skyttä) in branch 'master': bpo-35631: Improve typing docs wrt abstract/concrete collection types (GH-11396) https://github.com/python/cpython/commit

[issue35717] enum.Enum error on sys._getframe(2)

2019-01-11 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker <https://bugs.python.org/issue35717> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33416] Add endline and endcolumn to every AST node

2019-01-13 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: FYI, I started working on this. I will have PR ready end of next week. Serhiy, I don't think we should keep both this and issue22616 open. Which one would you prefer to close? -- ___ Python tracker <ht

[issue35631] Improve typing docs wrt abstract/concrete collection types

2019-01-02 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker <https://bugs.python.org/issue35631> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22616] Allow connecting AST nodes with corresponding source ranges

2019-01-14 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Closed as superseded by https://bugs.python.org/issue33416 -- superseder: -> Add endline and endcolumn to every AST node ___ Python tracker <https://bugs.python.org/issu

[issue22616] Allow connecting AST nodes with corresponding source ranges

2019-01-14 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue22616> ___ ___

[issue33416] Add endline and endcolumn to every AST node

2019-01-14 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > I'm sure we will find use cases though I doubt that many compiler syntax > errors would benefit (since a syntax error means that we don't have a > completely matched grammar rule). This is mostly useful for code analysis tools and IDEs. &g

[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-09-16 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > [..] but I think it's the best we can do. It's consistent with any other > class derived from tuple or list: [...] I agree with this argument. Sorry for delay with my response and thank you Eric for taking care about this

[issue35814] Syntax quirk with variable annotations

2019-01-24 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 62c35a8a8ff5854ed470b1c16a7a14f3bb80368c by Ivan Levkivskyi in branch 'master': bpo-35814: Allow same r.h.s. in annotated assignments as in normal ones (GH-11667) https://github.com/python/cpython/commit

[issue35814] Syntax quirk with variable annotations

2019-01-24 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.7 ___ Python tracker <https://bugs.python.or

[issue33416] Add endline and endcolumn to every AST node

2019-01-22 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Buildbots are green, this can be now closed. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35834] get_type_hints exposes an instance of ForwardRef (internal class) in its result, with `from __future__ import annotations` enabled

2019-01-27 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: It looks like an opposite side of https://github.com/python/typing/issues/508 (I wanted to work on it, but never had time to, sorry). This question appeared couple times before, and I think there are pros and cons for both returning a ForwardRef

[issue36466] Adding a way to strip annotations from compiled bytecode

2019-04-03 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: +1 from me. There are two ways to enable this: * Add -OOO that would remove all three: asserts, docstrings, annotations * Add separate --O-asserts --O-docstrings --O-annotations (or similar) I think I like the second option more. @cary Please note that our

[issue36495] Out-of-bounds array reads in Python/ast.c

2019-04-05 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided.

2019-03-29 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker <https://bugs.python.org/issue36470> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36466] Adding a way to strip annotations from compiled bytecode

2019-03-29 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +gvanrossum, levkivskyi ___ Python tracker <https://bugs.python.org/issue36466> ___ ___ Python-bugs-list mailing list Unsub

[issue36555] PEP484 @overload vs. str/bytes

2019-04-08 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Mypy already takes first overload for ambiguous arguments. This example is however genuinely unsafe from the static typing point of view. Please read the docs https://mypy.readthedocs.io/en/latest/more_types.html#type-checking-the-variants

[issue36042] Setting __init_subclass__ and __class_getitem__ methods are in runtime doesnt make them class method.

2019-02-20 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I totally agree with Serhiy -- ___ Python tracker <https://bugs.python.org/issue36042> ___ ___ Python-bugs-list mailin

[issue36320] typing.NamedTuple to switch from OrderedDict to regular dict

2019-03-17 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Good idea! This should be easy to fix/update, this was initially discussed in https://github.com/python/typing/issues/339. -- ___ Python tracker <https://bugs.python.org/issue36

<    1   2   3   4   5   6   7   >