[issue44662] Add ability to annotate types.Union

2021-07-30 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Yurii! ✨ 🍰 ✨

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44662] Add ability to annotate types.Union

2021-07-30 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 472997659b9c73089cdc22bd7eded6f6fdcffdfe by Miss Islington (bot) 
in branch '3.10':
bpo-44662: Add ability to annotate types.Union (GH-27214) (GH-27461)
https://github.com/python/cpython/commit/472997659b9c73089cdc22bd7eded6f6fdcffdfe


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44662] Add ability to annotate types.Union

2021-07-29 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +25984
pull_request: https://github.com/python/cpython/pull/27461

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44662] Add ability to annotate types.Union

2021-07-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 8182c8329c709f42218a8a17d81639ece5b7b627 by Yurii Karabas in 
branch 'main':
bpo-44662: Add ability to annotate types.Union (#27214)
https://github.com/python/cpython/commit/8182c8329c709f42218a8a17d81639ece5b7b627


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44662] Add ability to annotate types.Union

2021-07-19 Thread Ken Jin


Ken Jin  added the comment:

Nosied over people from issue44490. This issue addresses msg396895:

Thanks to Ruben for the catch. (message copied over):
```
It also lacks the __module__ attribute, causing it to be unusable in PEP 593 
typing.Annotated types:

from typing import Annotated
x: Annotated[int | str, 'test']

Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 
298, in inner
return cached(*args, **kwds)
  File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 
1594, in __class_getitem__
return _AnnotatedAlias(origin, metadata)
  File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 
1520, in __init__
super().__init__(origin, origin)
  File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 
976, in __init__
self.__module__ = origin.__module__
AttributeError: 'types.Union' object has no attribute '__module__'. Did you 
mean: '__reduce__'?
```

--
nosy: +ROpdebee, gvanrossum, kj, serhiy.storchaka
versions: +Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com