pytype icon indicating copy to clipboard operation
pytype copied to clipboard

A static type analyzer for Python code

Results 237 pytype issues
Sort by recently updated
recently updated
newest added

Example class: `test_pytype.py` ```py from typing import overload, Literal, Optional class A: @overload @staticmethod def f(x: None) -> None: ... @overload @staticmethod def f(x: Literal["hello"]) -> Literal["world"]: ... @staticmethod def...

bug
cat: callables

I've been running into a really strange bug: ``` FAILED: /home/soot/code/soot/experimental/amol/pytype-circular-import/.pytype/pyi/persistence/__init__.pyi /home/soot/code/soot/experimental/amol/pytype-circular-import/env/bin/python3 -m pytype.single --imports_info /home/soot/code/soot/experimental/amol/pytype-circular-import/.pytype/imports/persistence.__init__.imports --module-name persistence.__init__ -V 3.8 -o /home/soot/code/soot/experimental/amol/pytype-circular-import/.pytype/pyi/persistence/__init__.pyi --analyze-annotated --nofail --quick /home/soot/code/soot/experimental/amol/pytype-circular-import/src/persistence/__init__.py File "/home/soot/code/soot/experimental/amol/pytype-circular-import/src/persistence/__init__.py", line 5,...

bug
cat: infrastructure

### Example **a.py** ```python import abc from b import Mixin # pytype: disable=import-error class Base(abc.ABC): @abc.abstractmethod def foo(self): raise NotImplementedError class Derived(Mixin, Base): pass x = Derived() print(x.foo()) ``` **b.py**...

bug
cat: core

Elm has the option to output errors as JSON (via a flag), and something like that is handy for writing tooling around it. I'm trying to integrate `pytype` into [ALE](https://github.com/w0rp/ale)...

enhancement
good first issue
cat: infrastructure

We just upgraded from pytype 2021.11.29 to 2021.12.8, and we're getting [errors like this](https://github.com/google/python-spanner-orm/runs/4477225698?check_suite_focus=true) now: ``` FAILED: /home/runner/work/python-spanner-orm/python-spanner-orm/.pytype/pyi/spanner_orm/table_apis.pyi /opt/hostedtoolcache/Python/3.8.12/x64/bin/python -m pytype.single --imports_info /home/runner/work/python-spanner-orm/python-spanner-orm/.pytype/imports/spanner_orm.table_apis.imports --module-name spanner_orm.table_apis -V 3.8 -o /home/runner/work/python-spanner-orm/python-spanner-orm/.pytype/pyi/spanner_orm/table_apis.pyi --analyze-annotated...

bug
cat: infrastructure

pytype version: `2022.02.17` Ran on WSL2 ubuntu CMD: `/usr/bin/python3 -m pytype.single --imports_info /tmp/tmpsak_oti3/imports/hydra.core.player.imports --module-name hydra.core.player -V 3.8 -o /tmp/tmpsak_oti3/pyi/hydra/core/player.pyi --analyze-annotated --nofail --quick /mnt/c/Users/alias/Desktop/src/hydra/hydra/core/player.py` I get this error when trying to...

bug
cat: infrastructure

When using the `xml.dom.minidom` API, pytype 2022.02.17 fails. With 2022.2.8 this still worked. Minimal example: ```python import xml.dom.minidom xml.dom.minidom.parseString("") ``` Output from pytype: ``` Computing dependencies Analyzing 1 sources with...

bug
cat: stubs and 3p

Consider a function whose return type depends on the input. --- Defining the function without annotating the return type results in no errors: ```python def foo(x): if x == 1:...

bug
cat: control flow

Please consider two identical functions `test_func` and `a_test_func`, except for the function names. ```python from typing import Union import random def return_none_or_int() -> Union[int, None]: i = random.randint(0, 1) return...

bug
cat: control flow

#### Software versions Python 3.9.9 pytype 2022.01.13 #### Example ```python from typing import Optional flag: bool = False if flag: x = None else: x = 1 l: list[Optional[tuple[int]]] =...

bug
cat: control flow