[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-15 Thread Łukasz Langa
Łukasz Langa added the comment: Thanks, Serhiy! ✨ 🍰 ✨ -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-15 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 2746045a37e0d56ffdd8bb79f961bd7df0d1afba by Miss Islington (bot) in branch '3.9': bpo-45167: Fix deepcopying of GenericAlias (GH-28324) (GH-28368) https://github.com/python/cpython/commit/2746045a37e0d56ffdd8bb79f961bd7df0d1afba -- _

[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-15 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset de4c9c0bdc9b62e68dacd0c4bac20d7f4c527511 by Miss Islington (bot) in branch '3.10': bpo-45167: Fix deepcopying of GenericAlias (GH-28324) (GH-28367) https://github.com/python/cpython/commit/de4c9c0bdc9b62e68dacd0c4bac20d7f4c527511 --

[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-15 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26781 pull_request: https://github.com/python/cpython/pull/28367 ___ Python tracker _

[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-15 Thread miss-islington
Change by miss-islington : -- pull_requests: +26782 pull_request: https://github.com/python/cpython/pull/28368 ___ Python tracker ___ __

[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-15 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 5dce51a8875d9639786741e962b3cb208596b096 by Serhiy Storchaka in branch 'main': bpo-45167: Fix deepcopying of GenericAlias (GH-28324) https://github.com/python/cpython/commit/5dce51a8875d9639786741e962b3cb208596b096 -- ___

[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-13 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +26734 pull_request: https://github.com/python/cpython/pull/28324 ___ Python tracker ___

[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I meant that the current __getattr__ breaks deepcopy(). It can break also other protocols. It already has a list of exceptions, we need to add "__copy__" and "__deepcopy__" in this list. Or maybe exclude all dunder names by default and use a white list? -

[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-13 Thread Łukasz Langa
Łukasz Langa added the comment: Serhiy, can you elaborate how GH-28306 can break protocols using other special methods? I can't come up with an example. -- nosy: +lukasz.langa ___ Python tracker

[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is better to narrow the __getattr__. It can break protocols using other special methods. -- nosy: +gvanrossum, serhiy.storchaka ___ Python tracker

[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 ___ ___ Python-bugs-list m

[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 tracker

[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-10 Thread Jacob Hayes
New submission from Jacob Hayes : When deepcopying a parametrized types.GenericAlias (eg: a dict subclass) that has a __deepcopy__ method, the copy module doesn't detect the GenericAlias as a type and instead tries to call cls.__deepcopy__, passing `memo` inplace of self. This doesn't seem to