mypy
mypy copied to clipboard
Optional static typing for Python
**Bug Report** Using latest mypy 0.971 stub is incorrectly generated (missing import in case of multiple "same imports"). ``` from __future__ import absolute_import import typing import stubgenbug.common.circuit_breaker import stubgenbug.common.typing class...
stubgen: ``` class AuditContext(collections.namedtuple('AuditContext', ['user_id', 'ip'])): def from_request(cls, request): pass # somecode ``` generated as pyi: ``` class AuditContext: @classmethod def from_request(cls, request): ... ``` should be: ``` class AuditContext(collections.namedtuple('AuditContext',...
My [project](https://github.com/NETMVAS/feecc-spoke-daemon) directory structure is something like: ``` . ├── feecc_spoke │ ├── __init__.py ... │ └── waveshare_epd ... │ ├── epd2in13d.py │ ├── epdconfig.py │ └── __init__.py ... ├──...
Consider the following valid Python 3 code: ```python class A(): pass class B(): def __init__(self): self.a = A b = B() class C(b.a): pass ``` Actual behavior: Mypy will report...
In https://github.com/python/mypy/issues/2169 and https://github.com/python/mypy/issues/1843 there was discussion about using `Type[some_abc]` and how it should be allowed in a function signature, but that the call-site was expected to pass a concrete...
This pull request fixes #9838. It turns out that when an object is using a metaclass, it uses that metaclass as the fallback instead of `builtins.type`. This caused the `if...
Given the code ```python T = TypeVar("T", bound="Foo") P = ParamSpec("P") # this class serves as a decorator class print_y_first: def __call__( self, method: Callable[Concatenate[T, P], str] ) -> Callable[Concatenate[T,...
**Feature** I don't know about implementation details of mypy, whether it uses an own parser for Python code or could work based on Python's introspection capabilities. However, I think the...
**To Reproduce** `mypy -c "import logging; b=False; a:logging.Handler = logging.StreamHandler() if b else logging.FileHandler('test.log')"` **Expected Behavior** Should accept that `a` is a `logging.Handler` **Actual Behavior** `:1: error: Incompatible types in...
Hi, I'm trying to generate type stubs for [Locust](https://locust.io/) and stubgen fails with a timeout (see details below). I was wondering if someone has any insight into what causes this...