New submission from Nikita Sobolev <m...@sobolevn.me>:

While working on `mypy` support of `NamedTuple`s 
(https://github.com/python/mypy/issues/11047), I've noticed that currently when 
testing `typing.NamedTuple` cases like:

1. `N = NamedTuple('N')`

and

2.

```python
class N(NamedTuple):
    ...
```

are ignored. 

However, this is an important corner-cases, we need to be sure that use can 
create empty named tuples if needed.

Related position in code: 
https://github.com/python/cpython/blob/3f8b23f8ddab75d9b77a3997d54e663187e12cc8/Lib/test/test_typing.py#L4102-L4114

I will send a PR add these two cases.

----------
components: Tests
messages: 402557
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Empty typing.NamedTuple creation is not tested
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45280>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to