New submission from Nikita Sobolev <[email protected]>:
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 arguments that will have `Optional` added.
I think it is a good idea to add a test for this. Espeically given that we can
change function's behavior.
Context:
- https://bugs.python.org/issue46195
- https://github.com/python/cpython/pull/30304
----------
components: Library (Lib)
messages: 410307
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Add an explicit test for `get_type_hints` for a class field with `None`
default
versions: Python 3.11
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue46345>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com