Commit b88ec0c9 authored by Michael R. Crusoe's avatar Michael R. Crusoe 🏳️‍🌈
Browse files

New upstream version 0.720

parent 92291d5d
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
Metadata-Version: 2.1
Name: mypy
Version: 0.670
Version: 0.720
Summary: Optional static typing for Python
Home-page: http://www.mypy-lang.org/
Author: Jukka Lehtosalo
@@ -17,12 +17,11 @@ Description: Mypy -- Optional Static Typing for Python
        types.
        
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
+38 −24
Original line number Diff line number Diff line
@@ -64,14 +64,14 @@ See 'Development status' below.
Requirements
------------

You need Python 3.4 or later to run mypy.  You can have multiple Python
You need Python 3.5 or later to run mypy.  You can have multiple Python
versions (2.x and 3.x) installed on the same system without problems.

In Ubuntu, Mint and Debian you can install Python 3 like this:

    $ sudo apt-get install python3 python3-pip

For other Linux flavors, OS X and Windows, packages are available at
For other Linux flavors, macOS and Windows, packages are available at

  http://www.python.org/getit/

@@ -99,26 +99,30 @@ programs, even if they have type errors:

    $ python3 PROGRAM

[statically typed parts]: http://mypy.readthedocs.io/en/latest/basics.html#function-signatures
You can also try mypy in an [online playground](https://mypy-play.net/) (developed by
Yusuke Miyazaki).

[statically typed parts]: https://mypy.readthedocs.io/en/latest/getting_started.html#function-signatures-and-dynamic-vs-static-typing

IDE & Linter Integrations
-------------------------

IDE, Linter Integrations, and Pre-commit
----------------------------------------

Mypy can be integrated into popular IDEs:

* Vim: [vim-mypy](https://github.com/Integralist/vim-mypy)
* Vim: [syntastic](https://github.com/vim-syntastic/syntastic) in `.vimrc` add `let g:syntastic_python_checkers=['mypy']`
* Emacs: using [Flycheck](https://github.com/flycheck/) and [Flycheck-mypy](https://github.com/lbolla/emacs-flycheck-mypy)
* Sublime Text: [SublimeLinter-contrib-mypy](https://github.com/fredcallaway/SublimeLinter-contrib-mypy)
* Atom: [linter-mypy](https://atom.io/packages/linter-mypy)
* PyCharm: [mypy plugin](https://github.com/dropbox/mypy-PyCharm-plugin) (PyCharm integrates [its own implementation of PEP 484](https://www.jetbrains.com/help/pycharm/type-hinting-in-product.html))
* VS Code: provides [basic integration](https://code.visualstudio.com/docs/python/linting#_mypy) with mypy.

Mypy can also be integrated into [Flake8] using [flake8-mypy].
Mypy can also be integrated into [Flake8] using [flake8-mypy], or
can be set up as a pre-commit hook using [pre-commit mirrors-mypy].

[Flake8]: http://flake8.pycqa.org/
[flake8-mypy]: https://github.com/ambv/flake8-mypy

[pre-commit mirrors-mypy]: https://github.com/pre-commit/mirrors-mypy

Web site and documentation
--------------------------
@@ -152,7 +156,7 @@ dependencies, including the `typing` module, will be installed to
system-dependent locations.  Sometimes the script directory will not
be in `PATH`, and you have to add the target directory to `PATH`
manually or create a symbolic link to the script.  In particular, on
Mac OS X, the script may be installed under `/Library/Frameworks`:
macOS, the script may be installed under `/Library/Frameworks`:

    /Library/Frameworks/Python.framework/Versions/<version>/bin

@@ -186,7 +190,8 @@ you need to pull in the typeshed repo as follows:
    $ git submodule init
    $ git submodule update

Either way you should now have a subdirectory `typeshed` containing a
Either way you should now have a subdirectory `typeshed` inside your mypy repo,
your folders tree should be like `mypy/mypy/typeshed`, containing a
clone of the typeshed repo (`https://github.com/python/typeshed`).

From the mypy directory, use pip to install mypy:
@@ -224,6 +229,7 @@ Tests
The basic way to run tests:

    $ pip3 install -r test-requirements.txt
    $ python2 -m pip install -U typing
    $ ./runtests.py

For more on the tests, see [Test README.md](test-data/unit/README.md)
@@ -232,36 +238,44 @@ For more on the tests, see [Test README.md](test-data/unit/README.md)
Development status
------------------

Mypy is alpha software, but it has already been used in production
for well over a year at Dropbox, and it has an extensive test suite.
Mypy is beta software, but it has already been used in production
for several years at Dropbox, and it has an extensive test suite.

See [the roadmap](ROADMAP.md) if you are interested in plans for the
future.


Changelog
---------

Follow mypy's updates on the blog: http://mypy-lang.blogspot.com/


Issue tracker
-------------

Please report any bugs and enhancement ideas using the mypy issue
tracker:
tracker: https://github.com/python/mypy/issues

  https://github.com/python/mypy/issues
If you have any questions about using mypy or types, please ask
in the typing gitter instead: https://gitter.im/python/typing

Feel free to also ask questions on the tracker.

Compiled version of mypy
------------------------

mypy_mypyc
----------
We have built an compiled version of mypy using the [mypyc
compiler](https://github.com/mypyc/mypyc) for mypy-annotated Python
code. It is approximately 4 times faster than interpreted mypy and is
available (and the default) for 64-bit Windows, macOS, and Linux.

We have built an experimental compiled version of mypy using the
[mypyc compiler](https://github.com/mypyc/mypyc) for mypy-annotated
Python code. It is approximately 4 times faster than interpreted mypy.
To install an interpreted mypy instead, use:

If you wish to test out the compiled version of mypy, and are running
OS X or Linux, you can directly install a binary from
https://github.com/mypyc/mypy_mypyc-wheels/releases/latest.
    $ python3 -m pip install --no-binary mypy -U mypy

Compiled mypy packages on PyPI are Coming Soon.
If you wish to test out the compiled version of a development
version of mypy, you can directly install a binary from
https://github.com/mypyc/mypy_mypyc-wheels/releases/latest.


Help wanted
+10 −7
Original line number Diff line number Diff line
@@ -342,6 +342,11 @@ at least if your codebase is hundreds of thousands of lines or more:
Extended Callable types
***********************

.. note::

   This feature is deprecated.  You can use
   :ref:`callback protocols <callback_protocols>` as a replacement.

As an experimental mypy extension, you can specify ``Callable`` types
that support keyword arguments, optional arguments, and more.  When
you specify the arguments of a Callable, you can choose to supply just
@@ -454,11 +459,9 @@ is (roughly) equivalent to

.. note::

   This feature is experimental.  Details of the implementation may
   change and there may be unknown limitations. **IMPORTANT:**
   Each of the functions above currently just returns its ``type``
   argument, so the information contained in the argument specifiers
   is not available at runtime.  This limitation is necessary for
   backwards compatibility with the existing ``typing.py`` module as
   present in the Python 3.5+ standard library and distributed via
   PyPI.
   argument at runtime, so the information contained in the argument
   specifiers is not available at runtime.  This limitation is
   necessary for backwards compatibility with the existing
   ``typing.py`` module as present in the Python 3.5+ standard library
   and distributed via PyPI.
+4 −4
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ Functions

.. code-block:: python

   from typing import Callable, Iterable, Union, Optional, List
   from typing import Callable, Iterator, Union, Optional, List

   # This is how you annotate a function definition
   def stringify(num):
@@ -95,9 +95,9 @@ Functions
   x = f  # type: Callable[[int, float], float]

   # A generator function that yields ints is secretly just a function that
   # returns an iterable (see below) of ints, so that's how we annotate it
   def f(n):
       # type: (int) -> Iterable[int]
   # returns an iterator of ints, so that's how we annotate it
   def g(n):
       # type: (int) -> Iterator[int]
       i = 0
       while i < n:
           yield i
+3 −3
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ Python 3 supports an annotation syntax for function declarations.

.. code-block:: python

   from typing import Callable, Iterable, Union, Optional, List
   from typing import Callable, Iterator, Union, Optional, List

   # This is how you annotate a function definition
   def stringify(num: int) -> str:
@@ -104,8 +104,8 @@ Python 3 supports an annotation syntax for function declarations.
   x: Callable[[int, float], float] = f

   # A generator function that yields ints is secretly just a function that
   # returns an iterable (see below) of ints, so that's how we annotate it
   def f(n: int) -> Iterable[int]:
   # returns an iterator of ints, so that's how we annotate it
   def g(n: int) -> Iterator[int]:
       i = 0
       while i < n:
           yield i
Loading