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

Right now if I remove these lines:

```python
    if parameters == ():
        raise TypeError("Cannot take a Concatenate of no types.")
    if not isinstance(parameters, tuple):
        parameters = (parameters,)
    if not isinstance(parameters[-1], ParamSpec):
        raise TypeError("The last parameter to Concatenate should be a "
                        "ParamSpec variable.")
```

from here: 
https://github.com/python/cpython/blob/09087b8519316608b85131ee7455b664c00c38d2/Lib/typing.py#L601-L607

And run the test suite - it passes.

To increase coverage I plan to:
1. Add a test for empty `Concatenate[]`
2. Add a test case when `ParamSpec` is not the last item of `Concatenate`
3. When passed parameter to `Concatenate` is not `tuple`

PR is on its way :)

----------
components: Tests
messages: 410682
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Invalid usage of `Concatenate` is not covered at all
type: behavior
versions: Python 3.11

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

Reply via email to