python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Raising DeprecationWarning in mypy for PEP 585
In a project I'm working on we're extensively using type hinting. And we're now updating to python 3.9, with it's expanded type hinting functionality defined in PEP 585. And testing the change I ran i...
thevoiddancer
Votes: 0
Answers: 0
mypy 0.942 rejects 'match' only on Linux?
mypy 0.942 judges this program correct on Mac OS 12.2.1 but rejects the second line as a syntax error on Ubuntu 18.04:
e = 'a'
match e:
case name if isinstance(e, str):
print('name', e)
...
Ben Kovitz
Votes: 0
Answers: 1
Can type hinting infer type of class attribute from another?
There are subclasses that have the class attribute matcher_function set to a function. During instantiation that function is called and sets another attribute matcher. In all cases the return object...
Marcel Wilson
Votes: 0
Answers: 0
How can I make mypy tell me I am using features that are unsupported in older Python versions?
As an example, executing this code with Python versions older than 3.9 will raise an exception:
from concurrent.futures import Future
f: Future[int]
TypeError: 'type' object is not subscriptable
B...
mkrieger1
Votes: 0
Answers: 2