Skip to content
#

typing

Here are 540 public repositories matching this topic...

vuryleo
vuryleo commented Nov 8, 2019

e.g.

# map.py
def func(a: int) -> float:
    return float(a)

map(func, ['str'])
$ pytype map.py
Computing dependencies
Analyzing 1 sources with 0 local dependencies
ninja: Entering directory `/[redacted]/.pytype'
ninja: no work to do.
Success: no errors found

while

$ mypy map.py
map.py:5: error: Argument 1 to "map" has incompatible type "Ca
max-niederman
max-niederman commented Mar 15, 2021

Ideally there should be a way to install on at least some machines without cargo. This will need an installation script to install the language files in lieu of build.rs.

Some alternative installation methods which would be good to include are:

  • sh installation script w/ prebuilt binaries
  • AUR package

For prebuilt binaries, it would be ideal to setup GitHub workflows or similar so

mz8i
mz8i commented Mar 23, 2021

It might be useful to provide some kind of error classes as part of this package.
For example, I use code like this:

from argparse import ArgumentError, ArgumentParser

def file_path(x: str):
   d = Path(x)
   if d.is_dir:
      raise ArgumentError(f"{d} is a directory")
   return d

parser = ArgumentParser()
parser.add_argument('output_file', type=file_path, help="Path to 

Improve this page

Add a description, image, and links to the typing topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the typing topic, visit your repo's landing page and select "manage topics."

Learn more