Skip to content

Commit

Permalink
Remove mentions of Dynamic and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
JukkaL committed May 31, 2015
1 parent 04ab1f1 commit ae3602d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 44 deletions.
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ What is mypy?
-------------

Mypy is an optional static type checker for Python. You can add type
annotations to your Python programs and use mypy to type check them
statically to find errors before running them. You can also
seamlessly mix dynamic and static typing in your programs, so you can
always fall back to dynamic typing. Mypy programs are valid Python
3.x and you use a normal Python interpreter to run them. There is
essentially no performance overhead when using mypy, since mypy does
not introduce additional runtime type checking.
hints to your Python programs using the upcoming standard for type
annotations introduced in Python 3.5 beta 1 (PEP 484), and use mypy to
type check them statically. Find bugs in your programs without even
running them!

The type annotation notation has also been backported to earlier
Python 3.x versions. Mypy programs are valid Python 3.x and you use a
normal Python interpreter to run them. There is essentially no
performance overhead when using mypy, since mypy does not introduce
runtime type checking.

You can mix dynamic and static typing in your programs. You can always
fall back to dynamic typing when static typing is not convenient, such
as for legacy code.

Here is a small example to whet your appetite:

Expand Down Expand Up @@ -118,28 +125,20 @@ Development status
------------------

Mypy is work in progress and is not yet production quality (though
mypy development is already done in mypy!).
mypy development is already done using mypy!).

Here are some of the more significant Python features not supported
right now (but all of these will improve):

- Python 2.x support not really yet usable
- Python 2.x support not usable yet
- properties with setters not supported
- somewhat limited operator overloading
- limited metaclass support
- only a subset of Python standard library modules are supported, and some
only partially
- limited metaclass support
- 3rd party module support is limited

Some mypy-specific features are also not supported or only partially
supported, including these:

- function overloading does not work properly in all cases, including
some instances of method overriding, and keyword arguments
- no 'Dynamic' classes
- there is no way to use dynamic typing by default for top-level code

The current development focus is to support static type checking with a good
subset of Python features (both 2.x and 3.x).
The current development focus is to have a good coverage of Python
features and the standard library (initially 3.x, and later 2.7).


Issue tracker
Expand All @@ -150,6 +149,8 @@ tracker:

https://github.com/JukkaL/mypy/issues

Feel free to also ask questions on the tracker.


Help wanted
-----------
Expand Down
24 changes: 1 addition & 23 deletions docs/source/class_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,7 @@ initialized within the class. Mypy infers the types of attributes:
This is a bit like each class having an implicitly defined
``__slots__`` attribute. In Python semantics this is only enforced
during type checking: at runtime we use standard Python semantics. You
can selectively define a class as *dynamic*; dynamic classes have
Python-like compile-time semantics, and they allow you to assign to
arbitrary attributes anywhere in a program without the type checker
complaining:

.. code-block:: python
from typing import Dynamic
class A(Dynamic):
pass
a = A()
a.x = 2 # OK, no need to define x explicitly.
Mypy also lets you read arbitrary attributes of dynamic class
instances. This limits type checking effectiveness, so you should only
use dynamic classes when you really need them.

.. note::

Dynamic classes are not implemented in the current mypy version.
during type checking: at runtime we use standard Python semantics.

You can declare types of variables in the class body explicitly using
a type comment:
Expand Down

0 comments on commit ae3602d

Please sign in to comment.