-
**Feature**
Currently `Literal` doesn't accept another `Literal` or `Final[Literal]`. For example:
```python
from typing_extensions import Final, Literal
s: Final[Literal['ccc']] = 'ccc'
s1…
-
This is a port of https://github.com/python/typing/issues/159, which was closed as being out of scope, with https://github.com/srittau suggesting it maybe be more suitable for [typeshed](https://githu…
-
The attached program has three methods (`C.m`, `C.m_bad1`, `C.m_bad2`) that compute the same value; only one of them is accepted by mypy (and by sheer coincidence, `C.m` is the style that Guido prefer…
-
ruff incorrectly believes that the `__call__` method in a metaclass should be a classmethod and gives error N804 that the first argument should be named "cls" instead of "self", but only for immediate…
-
I found this function in our codebase and I'm trying to type it:
```python
def run_until_truthy(fn, num_tries=5):
for _ in range(num_tries):
if res := fn():
return res
…
-
Example:
```
dct = {"": ""}
# ok
trans = str.maketrans(dct)
"".translate(trans)
# err
"".translate(str.maketrans(dct))
```
* What is the actual behavior/output?
`maketrans.py:8: er…
z33ky updated
2 years ago
-
Consider the following (Python 3, of course)
```python
from typing import Any
class Foo:
def foo(self, x:Any) -> bool:
return isinstance(x, __class__)
```
mypy gives the followi…
-
A simplification of some old code I am trying to add mypy to:
```
class Base(object):
def foo(self):
# type: () -> None
a = self.static_foo()
class SubClass(Base):
s…
-
## Description
The default template has this code in `pipeline_registry.py`:
https://github.com/kedro-org/kedro/blob/7f447330fc4e933ae4f5f364bb38032600b78d85/kedro/templates/project/%7B%7B%20cooki…
-
I recently fixed a bug in pyright that caused a false negative when attempting to assign a `list[LiteralString]` to a `list[str]`. As we know, the type parameter for `list` is invariant, so these type…