[issue46014] functools.singledispatch does not support Union types

2022-04-03 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +30343 pull_request: https://github.com/python/cpython/pull/32282 ___ Python tracker <https://bugs.python.org/i

[issue46644] typing: remove callable() check from typing._type_check

2022-03-12 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- nosy: +uriyyo nosy_count: 8.0 -> 9.0 pull_requests: +29939 pull_request: https://github.com/python/cpython/pull/27553 ___ Python tracker <https://bugs.python.or

[issue46014] functools.singledispatch does not support Union types

2021-12-09 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 4.0 -> 5.0 pull_requests: +28241 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30017 ___ Python tra

[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2021-09-21 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Łukasz this issue is my original finding. I have found this case when I was working on another issue that was related to `typing.Protocol`. I agree that we can leave it as it is for now because I didn't find any information

[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-13 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- versions: +Python 3.10, Python 3.11 ___ Python tracker <https://bugs.python.org/issue45167> ___ ___ Pyth

[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-13 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 1.0 -> 2.0 pull_requests: +26720 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28306 ___ Python tra

[issue45121] Regression in 3.9.7 with typing.Protocol

2021-09-07 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 3.0 -> 4.0 pull_requests: +26630 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28206 ___ Python tra

[issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__

2021-09-02 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 4.0 -> 5.0 pull_requests: +26562 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28121 ___ Python tra

[issue45064] Raising AttributeError in descriptor decorator causing searching attribute in __mro__

2021-08-31 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Hi Mateusz, It's not a bug, it's expected behavior. __getattr__ called when the default attribute access fails with an AttributeError (either __getattribute__() raises an AttributeError because name is not an instance

[issue44919] TypedDict subtypes ignore any other metaclasses in 3.9+

2021-08-30 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 1.0 -> 2.0 pull_requests: +26501 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28057 ___ Python tra

[issue44524] __name__ attribute in typing module

2021-08-10 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +26195 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27710 ___ Python tracker <https://bugs.python.or

[issue44806] Subclassing Protocol get different __init__

2021-08-02 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +26068 pull_request: https://github.com/python/cpython/pull/27543 ___ Python tracker <https://bugs.python.org/i

[issue34422] __name__ not available for classes in typing module

2021-08-02 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: I believe we can close this issue. It has been fixed in scope of this issue - https://bugs.python.org/issue44524 -- nosy: +uriyyo ___ Python tracker <https://bugs.python.org/i

[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2021-08-02 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 1.0 -> 2.0 pull_requests: +26060 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27553 ___ Python tra

[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2021-08-02 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +26052 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27543 ___ Python tracker <https://bugs.python.or

[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2021-08-02 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: typing.Protocol silently overrides __init__ method of delivered class. I think it should be forbidden to define __init__ method at Protocol delivered class in case if cls is not Protocol. -- components: Library (Lib) me

[issue44806] Subclassing Protocol get different __init__

2021-08-02 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +26050 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27541 ___ Python tracker <https://bugs.python.or

[issue44806] Subclassing Protocol get different __init__

2021-08-02 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: When we subclassing Protocol, we get a __init__ differing from default one but the protocol in question didn't define any __init__. More information can be found here - https://github.com/python/typing/issues/644 --

[issue44775] Speed-up typing.cast by implementing it in C

2021-07-30 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +25993 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27474 ___ Python tracker <https://bugs.python.or

[issue44775] Speed-up typing.cast by implementing it in C

2021-07-30 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: In scope of https://github.com/python/cpython/pull/27262 we have introduce `_typing` module with typing related helper functions. It will be great to speedup `typing.cast` function by implementing it in C. I have already done

[issue44761] NewType __module__ attr default value

2021-07-28 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- title: NewType __module__ name default value -> NewType __module__ attr default value ___ Python tracker <https://bugs.python.or

[issue44761] NewType __module__ name default value

2021-07-28 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +25939 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27406 ___ Python tracker <https://bugs.python.or

[issue44761] NewType __module__ name default value

2021-07-28 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- title: NewType __module__ name -> NewType __module__ name default value ___ Python tracker <https://bugs.python.or

[issue44761] NewType __module__ name

2021-07-28 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: This issue related to https://bugs.python.org/issue44353 By default `__module__` attribute of a `NewType` is set to "typing" but in other typing classes it set to "__main__". -- components: Library (

[issue44747] Reduce usage of sys._getframe at typing module

2021-07-27 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +25920 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27387 ___ Python tracker <https://bugs.python.or

[issue44747] Reduce usage of sys._getframe at typing module

2021-07-27 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: While I was working with `typing` I have notice that there are duplication of `_getframe` usage. While In scope of issue 44353 I introduced `typing._callee` function which allow to return module name of a caller function. In sc

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

2021-07-23 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: `NewType` was converted into callable class at scope of https://bugs.python.org/issue44353 Currently `repr` of `NewType` is: ``` >>> UserId = NewType("UserId", int) __main__.UserId ```

[issue44353] PEP 604 NewType

2021-07-23 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +25849 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27305 ___ Python tracker <https://bugs.python.or

[issue44353] PEP 604 NewType

2021-07-23 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +25846 pull_request: https://github.com/python/cpython/pull/27302 ___ Python tracker <https://bugs.python.org/i

[issue44353] PEP 604 NewType

2021-07-20 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +25807 pull_request: https://github.com/python/cpython/pull/27262 ___ Python tracker <https://bugs.python.org/i

[issue44353] PEP 604 NewType

2021-07-20 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Jelle thanks for pointing this out, I will implement helper function in C and use it as a __call__ method for NewType -- ___ Python tracker <https://bugs.python.org/i

[issue44353] PEP 604 NewType

2021-07-20 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +25804 pull_request: https://github.com/python/cpython/pull/27259 ___ Python tracker <https://bugs.python.org/i

[issue44353] PEP 604 NewType

2021-07-19 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: I opened PR with refactored `typing.NewType` into callable class. Also I have added `__module__` attr to typing.NewType so it will become pickable. -- ___ Python tracker

[issue44353] PEP 604 NewType

2021-07-19 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +25798 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27250 ___ Python tracker <https://bugs.python.or

[issue44353] PEP 604 NewType

2021-07-19 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: @Ken thanks for pointing this out. The only solution which I see is to convert NewType into callable class but it will lead to performance degradation. @Ken what do you think abou

[issue44676] Add ability to serialise types.Union

2021-07-19 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +25792 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27244 ___ Python tracker <https://bugs.python.or

[issue44676] Add ability to serialise types.Union

2021-07-19 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- type: -> enhancement ___ Python tracker <https://bugs.python.org/issue44676> ___ ___ Python-bugs-li

[issue44662] Add ability to annotate types.Union

2021-07-19 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- title: Add ability to serialise and annotate types.Union -> Add ability to annotate types.Union ___ Python tracker <https://bugs.python.or

[issue44676] Add ability to serialise types.Union

2021-07-19 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- versions: +Python 3.11 ___ Python tracker <https://bugs.python.org/issue44676> ___ ___ Python-bugs-list

[issue44676] Add ability to serialise types.Union

2021-07-19 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: It was discussed at https://bugs.python.org/issue44490 -- messages: 397814 nosy: uriyyo priority: normal severity: normal status: open title: Add ability to serialise types.Union ___

[issue44524] __name__ attribute in typing module

2021-07-19 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 5.0 -> 6.0 pull_requests: +25786 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27237 ___ Python tra

[issue44633] Indexing the union type can return NotImplemented

2021-07-17 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +25756 pull_request: https://github.com/python/cpython/pull/26980 ___ Python tracker <https://bugs.python.org/i

[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-17 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +25757 pull_request: https://github.com/python/cpython/pull/26980 ___ Python tracker <https://bugs.python.org/i

[issue44662] Add ability to serialise and annotate types.Union

2021-07-17 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- title: Add ability to serialise and annotated types.Union -> Add ability to serialise and annotate types.Union ___ Python tracker <https://bugs.python.or

[issue44662] Add ability to serialise and annotated types.Union

2021-07-17 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +25754 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27214 ___ Python tracker <https://bugs.python.or

[issue44662] Add ability to serialise and annotated types.Union

2021-07-17 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: It was discussed at https://bugs.python.org/issue44490 -- messages: 397720 nosy: uriyyo priority: normal severity: normal status: open title: Add ability to serialise and annotated types.Union type: enhancement versions:

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-07-17 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +25753 pull_request: https://github.com/python/cpython/pull/27215 ___ Python tracker <https://bugs.python.org/i

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-07-17 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +25752 pull_request: https://github.com/python/cpython/pull/27214 ___ Python tracker <https://bugs.python.org/i

[issue44633] Indexing the union type can return NotImplemented

2021-07-17 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 3.0 -> 4.0 pull_requests: +25744 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26980 ___ Python tra

[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-17 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 3.0 -> 4.0 pull_requests: +25745 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26980 ___ Python tra

[issue44353] PEP 604 NewType

2021-07-12 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Jelle I can try to implement it in C to see if it will give better performance. -- ___ Python tracker <https://bugs.python.org/i

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-07-06 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +25604 pull_request: https://github.com/python/cpython/pull/27048 ___ Python tracker <https://bugs.python.org/i

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-07-01 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +25542 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26980 ___ Python tracker <https://bugs.python.or

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-06-30 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: @Ken I will pick up this issue, thanks for asking. -- ___ Python tracker <https://bugs.python.org/i

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-06-29 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Should `__getitem__` be implemented for `types.Union`? I can implement it if no one is working on it. P.S. mypy currently does not support it: ``` Value of type "types.Union" is not indexable ```

[issue44353] PEP 604 NewType

2021-06-10 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: What about to return callable object instead of function from a `typing.NewType`? It will look something like this: ``` class _NewType: __slots__ = ('__name__', '__supertype__') def __init__(self, name

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Please forget my previous msg, this bug still present at 3.11 version. PR contains fix proposed by Kevin. Sorry for making to much noise. -- ___ Python tracker <https://bugs.p

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: I checked and this bug is not present at 3.11 version. So I simply added test to cover case mentioned by Ivan. -- ___ Python tracker <https://bugs.python.org/i

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Hi Guido, I decided to help with this issue as far as Kevin did not respond. -- ___ Python tracker <https://bugs.python.org/i

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 3.0 -> 4.0 pull_requests: +24708 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26067 ___ Python tra

[issue43243] Strict ABC classes

2021-02-17 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Sorry about this, in a future I will use forum for such discussions. -- ___ Python tracker <https://bugs.python.org/i

[issue43243] Strict ABC classes

2021-02-17 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: When I work with ABC classes usually I faced a problem - I forget to implement one of the methods or make a typo in the method name. In such case I will know about it only when I will try to instantiate a class. In case

[issue43243] Strict ABC classes

2021-02-17 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +23339 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24558 ___ Python tracker <https://bugs.python.or

[issue43243] Strict ABC classes

2021-02-17 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: Basically, the idea is to add the ability to mark abstract classes as strict. What does this mean - in case when a class inherits from a strict abstract base class and doesn't implement all abstract methods then it will fai

[issue43085] Loosening | and |= operator type checking restriction

2021-02-01 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +23228 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24413 ___ Python tracker <https://bugs.python.or

[issue43085] Loosening | and |= operator type checking restriction

2021-02-01 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Hi Raymond, I was trying to add __or__ method for collections.abc.Mapping, __ior__ method for collections.abc.MutableMapping, link to issue - https://bugs.python.org/issue42841. I can extract code and move it to separate classes

[issue42269] Add ability to set __slots__ in dataclasses

2021-01-08 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Hi Eric, I tried to help you with this feature and have opened a PR. I thought that you are too busy to implement this feature, so that's why I decided to help you (It almost two months since your last message in

[issue42269] Add ability to set __slots__ in dataclasses

2021-01-08 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 5.0 -> 6.0 pull_requests: +22998 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24171 ___ Python tra

[issue42841] Add bitwise or operator to collections.abc Mapping and MutableMapping

2021-01-06 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Thanks, for the replies, didn't know about that. Interesting thing that `collections.abc.Set` base class has implementations of `__and__`, `__or__`, `__sub__` and `__xor__` methods, it also provide `_from_iterable` class met

[issue42841] Add bitwise or operator to collections.abc Mapping and MutableMapping

2021-01-06 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +22970 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24141 ___ Python tracker <https://bugs.python.or

[issue42841] Add bitwise or operator to collections.abc Mapping and MutableMapping

2021-01-06 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- components: +Library (Lib) type: -> enhancement ___ Python tracker <https://bugs.python.or

[issue42841] Add bitwise or operator to collections.abc Mapping and MutableMapping

2021-01-06 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: In python3.9 `dict` `bitwise or` operator was introduced. I think it will be great if `collections.abc.Mapping` and `collections.abc.MutableMapping` will have a default implementation of `bitwise or` operator. -- me

[issue42812] @overload-ing method of parent class without actual implementation

2021-01-03 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: > What is better? Sorry, I can't answer this question. I am a regular python user and I just tried to help with your issue. I believe we should wait for someone from core team to answer this question. > In your exampl

[issue42812] @overload-ing method of parent class without actual implementation

2021-01-03 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: I think the simplest solution in your case is not to use `@overload`, as far as I understand you want to override the signature of base method. This code won't produce any error when used with `mypy`: ``` class Parent:

[issue42812] @overload-ing method of parent class without actual implementation

2021-01-03 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: `mypy` will produce an error on such code: ``` class Parent: def foo(self, **kwargs): """Argument names of foo vary depending on the child class.""" class Child(Parent): @overload

[issue42812] @overload-ing method of parent class without actual implementation

2021-01-03 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: The purpose of `@overload` is quite different. I believe you thought that this is smth like `@override` in Java world but it different. Basically, the correct usage of `@overaload` is: ``` @overload def process(response: None) -

[issue42455] Add decorator_factory function to functools module

2021-01-03 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: What we should do with this issue? There was no much discussion at python-ideas. I have received only one -1 opinion. -- ___ Python tracker <https://bugs.python.org/i

[issue42815] new thread doesn't copy context of the parent thread

2021-01-03 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +22907 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24074 ___ Python tracker <https://bugs.python.or

[issue42815] new thread doesn't copy context of the parent thread

2021-01-03 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: New thread doesn't copy context of the parent thread. The minimal example to reproduce the issue: ``` from threading import Thread from contextvars import ContextVar foo: ContextVar[str] = ContextVar("foo")

[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2020-12-27 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: You a totally right, looks like I tried to add a feature that no one asked for:) I have updated PR and removed `name` parameter from `property` constuctor. Thanks for your

[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2020-12-27 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Raymond, it's a good question. I have added `name` to `property` constructor to support cases when a property is added to a class after it was declared. For instance: ``` class Foo: pass Foo.foo = property(name=

[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2020-12-27 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: I have implemented this feature using an idea provided by Xiang Zhang. Basically, property has new optional attribute `name` which will be added to msg of `AttributeError` in a case when `name`

[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2020-12-27 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 8.0 -> 9.0 pull_requests: +22812 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/23967 ___ Python tra

[issue42525] Optimize class/module level annotation

2020-12-20 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: After several attempts to optimize class/module annotations, I didn't find a solution that won't break existing code and can cover all existing edge cases. The root cause was mentioned by Inada, the problem that `__a

[issue41891] asyncio.wait_for does not wait for task/future to be completed in all cases

2020-12-18 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Yurii no worries, I am happy that this issue is resolved) -- nosy: +uriyyo ___ Python tracker <https://bugs.python.org/i

[issue42600] Cancelling tasks waiting for asyncio.Conditions crashes w/ RuntimeError: Lock is not acquired.

2020-12-17 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Hey Yurii, I have fixed this issue. The actual problem was that `wait_for` cancels passed future but doesn't wait until it finished. -- ___ Python tracker <https://bugs.python.

[issue42600] Cancelling tasks waiting for asyncio.Conditions crashes w/ RuntimeError: Lock is not acquired.

2020-12-17 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 4.0 -> 5.0 pull_requests: +22689 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23829 ___ Python tra

[issue42562] dis failed to parse function that has only annotations

2020-12-03 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +22501 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23632 ___ Python tracker <https://bugs.python.or

[issue42562] dis failed to parse function that has only annotations

2020-12-03 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: `dis` module failed when trying to parse function that has only annotations at the function body: ``` def foo(): a: int ``` Failed with stacktrace: ``` 1 0 LOAD_CONST 0 () 2 LOAD

[issue42525] Optimize class/module level annotation

2020-12-03 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: As all annotations are known at compilation time we can optimize annotations creating. For instance, we have such code: ``` a: int b: int ``` With the current implementation, we will have such bytecode: ``` 1

[issue42525] Optimize class/module level annotation

2020-12-01 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: This issue is inspired by https://bugs.python.org/issue42202 We can do smth similar for class/module level annotations. Inada Naoki what do you think regarding that? -- components: Interpreter Core messages: 38226

[issue42455] Add decorator_factory function to functools module

2020-11-30 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: I have posted this idea to python-ideas Link to thread https://mail.python.org/archives/list/python-id...@python.org/thread/OIRAB3QA4AAD3JGH2S5HMGCPDLGG7T52/ -- ___ Python tracker

[issue42455] Add decorator_factory function to functools module

2020-11-30 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Let's wait for Nick. I have found great examples to show how decorator_factory can simplify things. dataclasses.dataclass ``` def dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False, unsafe

[issue42392] remove the deprecated 'loop' parameter asyncio API

2020-11-29 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Looks like we have done everything, we can close this issue -- ___ Python tracker <https://bugs.python.org/i

[issue42455] Add decorator_factory function to functools module

2020-11-29 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- title: Add decorator_with_params function to functools module -> Add decorator_factory function to functools module ___ Python tracker <https://bugs.python.or

[issue42455] Add decorator_with_params function to functools module

2020-11-29 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: I agree, decorator factory definitely a better name -- ___ Python tracker <https://bugs.python.org/i

[issue42392] remove the deprecated 'loop' parameter asyncio API

2020-11-29 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +22432 pull_request: https://github.com/python/cpython/pull/23552 ___ Python tracker <https://bugs.python.org/i

[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-26 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +22405 pull_request: https://github.com/python/cpython/pull/23521 ___ Python tracker <https://bugs.python.org/i

[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-25 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +22402 pull_request: https://github.com/python/cpython/pull/23517 ___ Python tracker <https://bugs.python.org/i

[issue42459] Wrong Output

2020-11-25 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: There is a little error in your code, it should look like this: ``` def test(sum): return int(sum) if test(10) == 10: print("Yes") else: print("No") ``` Basically `if sum == 10:` will compare bui

  1   2   >