Sep
OCT
Nov
28
2019
2020
2021
About this capture
T h e W a y b a c k M a c h i n e - h t t p : / / w e b . a r c h i v e . o r g / w e b / 2 0 2 0 1 0 2 8 2 1 3 9 0 7 / h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y
S k i p t o c o n t e n t
/ ; r e f _ c t a : S i g n u p ; r e f _ l o c : h e a d e r l o g g e d o u t " >
S i g n up
●
F e a t u r e s →
● C o d e r e v i e w
● P r o j e c t m a n a g e m e n t
● I n t e g r a t i o n s
● A c t i o n s
● P a c k a g e s
● S e c u r i t y
● T e a m m a n a g e m e n t
● H o s t i n g
● M o b i l e
● C u s t o m e r s t o r i e s →
● S e c u r i t y →
●
●
●
● E x p l o r e G i t H u b →
L e a r n & c o n t r i b u t e
● T o p i c s
● C o l l e c t i o n s
● T r e n d i n g
● L e a r n i n g L a b
● O p e n s o u r c e g u i d e s
C o n n e c t w i t h o t h e r s
● E v e n t s
● C o m m u n i t y f o r u m
● G i t H u b E d u c a t i o n
● G i t H u b S t a r s p r o g r a m
●
●
P l a n s →
● C o m p a r e p l a n s
● C o n t a c t S a l e s
● N o n p r o f i t →
● E d u c a t i o n →
In this repository
All GitHub
↵
Jump to
↵
No suggested jump to results
{ { m e s s a g e } }
●
W a t c h
1 9 9
●
S t a r
9 . 3 k
●
F o r k
1 . 5 k
O p t i o n a l s t a t i c t y p i n g f o r P y t h o n 3 a n d 2 ( P E P 4 8 4 )
w w w . m y p y - l a n g . o r g /
V i e w l i c e n s e
9 . 3 k
s t a r s
1 . 5 k
f o r k s
S t a r
W a t c h
●
C o d e
●
I s s u e s
1 . 4 k
●
P u l l r e q u e s t s
49
●
A c t i o n s
●
P r o j e c t s
0
●
W i k i
●
S e c u r i t y
●
I n s i g h t s
M o r e
●
C o d e
●
I s s u e s
●
P u l l r e q u e s t s
●
A c t i o n s
●
P r o j e c t s
●
W i k i
●
S e c u r i t y
●
I n s i g h t s
D i s m i s s
J o i n G i t H u b t o d a y
G i t H u b i s h o m e t o o v e r 5 0 m i l l i o n d e v e l o p e r s w o r k i n g t o g e t h e r t o h o s t a n d r e v i e w c o d e , m a n a g e p r o j e c t s , a n d b u i l d s o f t w a r e t o g e t h e r .
S i g n u p
23
b r a n c h e s
49
t a g s
G o t o f i l e
C o d e
C l o n e
U s e G i t o r c h e c k o u t w i t h S V N u s i n g t h e w e b U R L .
W o r k f a s t w i t h o u r o f f i c i a l C L I .
L e a r n m o r e .
●
O p e n w i t h G i t H u b D e s k t o p
●
D o w n l o a d Z I P
L a u n c h i n g G i t H u b D e s k t o p
I f n o t h i n g h a p p e n s , d o w n l o a d G i t H u b D e s k t o p a n d t r y a g a i n .
G o b a c k
L a u n c h i n g G i t H u b D e s k t o p
I f n o t h i n g h a p p e n s , d o w n l o a d G i t H u b D e s k t o p a n d t r y a g a i n .
G o b a c k
L a u n c h i n g X c o d e
I f n o t h i n g h a p p e n s , d o w n l o a d X c o d e a n d t r y a g a i n .
G o b a c k
L a u n c h i n g V i s u a l S t u d i o
I f n o t h i n g h a p p e n s , d o w n l o a d t h e G i t H u b e x t e n s i o n f o r V i s u a l S t u d i o a n d t r y a g a i n .
G o b a c k
L a t e s t c o m m i t
T h e - C o m p i l e r
R e - a d d f a l l b a c k f o r z e r o t e r m i n a l w i d t h ( # 9 6 5 1 )
…
4 4 8 1 8 9 8
O c t 2 8 , 2 0 2 0
R e - a d d f a l l b a c k f o r z e r o t e r m i n a l w i d t h ( # 9 6 5 1 )
Contrary to what I assumed in #9143 , shutil.get_terminal_size() doesn't
actually handle a 0 width from os.get_terminal_size() - it only handles
a 0 COLUMNS environment variable.
Thus, this caused #8144 to regress.
This change re-adds and uses DEFAULT_COLUMNS and also adds the test
which was deemed unnecessary in #8145 - this regression proves that I'd
have been a good idea to add it in the first place.
(Test written by Anthony Sottile)
Fixes pre-commit/mirrors-mypy#29
4 4 8 1 8 9 8
G i t s t a t s
●
9 , 2 3 0
c o m m i t s
F i l e s
P e r m a l i n k
F a i l e d t o l o a d l a t e s t c o m m i t i n f o r m a t i o n .
T y p e
N a m e
L a t e s t c o m m i t m e s s a g e
C o m m i t t i m e
. g i t h u b
A d d a s e p a r a t e i s s u e f o r m t o r e p o r t c r a s h e s ( # 9 5 4 9 )
O c t 8 , 2 0 2 0
d o c s
" c l a s s = " l i n k - g r a y " h r e f = " / w e b / 2 0 2 0 1 0 2 8 2 1 3 9 0 7 / h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / 8 c 2 e a 0 f c b f d e 9 8 c 2 4 0 3 9 d d 2 7 1 e 5 0 5 b e b 0 4 d a e 2 5 c " > U p d a t e F A Q t o i n c l u d e M y P y n o t w o r k i n g o n P y P y ( # 8 8 7 9 " c l a s s = " l i n k - g r a y " h r e f = " / w e b / 2 0 2 0 1 0 2 8 2 1 3 9 0 7 / h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / 8 c 2 e a 0 f c b f d e 9 8 c 2 4 0 3 9 d d 2 7 1 e 5 0 5 b e b 0 4 d a e 2 5 c " > )
O c t 1 8 , 2 0 2 0
m i s c
U p d a t e w h e e l d o w n l o a d s c r i p t t o u s e t h e c o r r e c t f i l e n a m e s f o r m a c O S ( # …
O c t 8 , 2 0 2 0
m y p y
R e - a d d f a l l b a c k f o r z e r o t e r m i n a l w i d t h ( # 9 6 5 1 )
O c t 2 8 , 2 0 2 0
m y p y c
[ m y p y c ] F i x t y p e o f f o r l o o p i n d e x r e g i s t e r i n f o r o v e r r a n g e ( # 9 6 3 4 )
O c t 2 5 , 2 0 2 0
s c r i p t s
[ m y p y c ] F i x s p e c i f y i n g o p t l e v e l w i t h s c r i p t s / m y p y c ( # 8 8 5 8 )
M a y 2 0 , 2 0 2 0
t e s t - d a t a
" c l a s s = " l i n k - g r a y " h r e f = " / w e b / 2 0 2 0 1 0 2 8 2 1 3 9 0 7 / h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / a 0 5 4 2 c 1 d 7 a 6 c e 3 0 8 8 d a 3 7 d 6 9 6 b 8 f a 2 f 5 d 6 7 e b d 5 7 " > m o d u l e f i n d e r : m a k e - p h a n d l e n a m e s p a c e p a c k a g e s c o r r e c t l y ( # 9 6 1 6 " c l a s s = " l i n k - g r a y " h r e f = " / w e b / 2 0 2 0 1 0 2 8 2 1 3 9 0 7 / h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / a 0 5 4 2 c 1 d 7 a 6 c e 3 0 8 8 d a 3 7 d 6 9 6 b 8 f a 2 f 5 d 6 7 e b d 5 7 " > )
O c t 2 4 , 2 0 2 0
. g i t i g n o r e
i g n o r e a l l v i m t e m p o r a r y f i l e s ( # 9 0 2 2 )
J u n 2 6 , 2 0 2 0
. g i t m o d u l e s
U s e p a c k a g e _ d a t a t o s h i p t y p e s h e d a n d x m l f i l e s ( # 5 5 1 7 )
A u g 3 1 , 2 0 1 8
. t r a v i s . y m l
S t a r t u s i n g P y t h o n 3 . 9 o n T r a v i s ( # 9 6 5 3 )
O c t 2 7 , 2 0 2 0
C O N T R I B U T I N G . m d
C l e a n u p c r e d i t s ( # 4 6 2 6 )
F e b 2 3 , 2 0 1 8
C R E D I T S
A d d r e m a i n i n g c o r e t e a m e m a i l s t o C R E D I T S ( # 4 6 2 9 )
F e b 2 4 , 2 0 1 8
L I C E N S E
M e r g e h t t p s : / / g i t h u b . c o m / m y p y c / m y p y c i n t o m e r g e - m y p y c
A u g 2 1 , 2 0 1 9
M A N I F E S T . i n
" c l a s s = " l i n k - g r a y " h r e f = " / w e b / 2 0 2 0 1 0 2 8 2 1 3 9 0 7 / h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / f 5 f 5 4 8 5 3 8 7 c 3 a c 9 f 4 b b b 5 6 c 0 3 6 f a e e 2 a 1 a b d a a 7 0 " > M A N I F E S T . i n : s i m p l i f y a n d r o b u s t - i f y ( # 9 5 9 2 " c l a s s = " l i n k - g r a y " h r e f = " / w e b / 2 0 2 0 1 0 2 8 2 1 3 9 0 7 / h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / f 5 f 5 4 8 5 3 8 7 c 3 a c 9 f 4 b b b 5 6 c 0 3 6 f a e e 2 a 1 a b d a a 7 0 " > )
O c t 1 8 , 2 0 2 0
R E A D M E . m d
" c l a s s = " l i n k - g r a y " h r e f = " / w e b / 2 0 2 0 1 0 2 8 2 1 3 9 0 7 / h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / 4 9 a 8 c 1 0 2 a 1 1 d 3 e c 8 f f c 4 8 d c 0 a 6 d 5 4 0 9 e d 6 0 7 6 7 f d " > R E A D M E . m d : r e m o v e m e n t i o n o f f l a k e 8 - m y p y ( # 9 5 3 2 " c l a s s = " l i n k - g r a y " h r e f = " / w e b / 2 0 2 0 1 0 2 8 2 1 3 9 0 7 / h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / 4 9 a 8 c 1 0 2 a 1 1 d 3 e c 8 f f c 4 8 d c 0 a 6 d 5 4 0 9 e d 6 0 7 6 7 f d " > )
O c t 5 , 2 0 2 0
R O A D M A P . m d
U p d a t e r o a d m a p ( # 6 3 7 8 )
F e b 1 2 , 2 0 1 9
c o n f t e s t . p y
M e r g e h t t p s : / / g i t h u b . c o m / m y p y c / m y p y c i n t o m e r g e - m y p y c
A u g 2 1 , 2 0 1 9
m y p y - r e q u i r e m e n t s . t x t
[ m y p y c ] A d d a m y p y c _ a t t r t o s u p p o r t i n t e r p r e t e d s u b c l a s s e s ( # 8 0 0 4 )
N o v 2 8 , 2 0 1 9
m y p y _ b o o t s t r a p . i n i
U p d a t e m y p y c t o 0 . 0 . 1 + d e v . 1 6 6 1 5 1 c 2 d c 2 c 2 e b 1 3 4 4 8 d 5 6 e 2 d d 3 1 a 9 7 9 8 5 5 7 5 5 4 ( # …
A u g 8 , 2 0 1 9
m y p y _ s e l f _ c h e c k . i n i
m y p y s e l f c h e c k : a d d p y t h o n _ v e r s i o n = 3 . 5 ( # 8 3 8 2 )
F e b 7 , 2 0 2 0
p y p r o j e c t . t o m l
e n a b l e i s o l a t e d b u i l d v i a t h e P E P - 5 1 7 / 5 1 8 s p e c ( # 6 1 7 5 )
F e b 2 6 , 2 0 1 9
p y t e s t . i n i
U s e p y t e s t N o d e . f r o m _ p a r e n t i f a v a i l a b l e ( # 9 2 6 3 )
A u g 4 , 2 0 2 0
r u n t e s t s . p y
" c l a s s = " l i n k - g r a y " h r e f = " / w e b / 2 0 2 0 1 0 2 8 2 1 3 9 0 7 / h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / 7 f 6 3 b 4 9 6 1 0 6 4 a d 7 3 6 a d 2 6 4 7 f 7 c e e 9 9 8 6 3 1 1 0 1 4 2 4 " > r u n t e s t s . p y : l i s t t e s t s t o r u n i n t y p e s h e d C I ( # 9 6 3 8 " c l a s s = " l i n k - g r a y " h r e f = " / w e b / 2 0 2 0 1 0 2 8 2 1 3 9 0 7 / h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / 7 f 6 3 b 4 9 6 1 0 6 4 a d 7 3 6 a d 2 6 4 7 f 7 c e e 9 9 8 6 3 1 1 0 1 4 2 4 " > )
O c t 2 7 , 2 0 2 0
s e t u p . c f g
" c l a s s = " l i n k - g r a y " h r e f = " / w e b / 2 0 2 0 1 0 2 8 2 1 3 9 0 7 / h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / c 9 0 b 4 0 5 9 3 4 c b f 2 1 4 2 b 8 a 5 7 5 d d d 8 9 d b e d f 7 6 2 1 0 6 c " > m y p y : f i x c i , u s e a n e w e r f l a k e 8 a n d f l a k e 8 - p y i , i g n o r e a n e w e r r o r ( # …
M a y 1 3 , 2 0 2 0
s e t u p . p y
s e t u p . p y : u s e f i n d _ p a c k a g e s ( # 9 5 9 3 )
O c t 1 8 , 2 0 2 0
t e s t - r e q u i r e m e n t s . t x t
U n p i n s e t u p t o o l s v e r s i o n ( # 9 4 7 0 )
S e p 2 3 , 2 0 2 0
t o x . i n i
s t u b t e s t : a d d t e s t s ( # 8 3 8 0 )
F e b 1 3 , 2 0 2 0
V i e w c o d e
R E A D M E . m d
M y p y : O p t i o n a l S t a t i c T y p i n g f o r P y t h o n
G o t a q u e s t i o n ? J o i n u s o n G i t t e r !
W e d o n ' t h a v e a m a i l i n g l i s t ; b u t w e a r e a l w a y s h a p p y t o a n s w e r
q u e s t i o n s o n g i t t e r c h a t . I f y o u a r e
s u r e y o u ' v e f o u n d a b u g p l e a s e s e a r c h o u r i s s u e t r a c k e r s f o r a
d u p l i c a t e b e f o r e f i l i n g a n e w i s s u e :
● m y p y t r a c k e r
f o r m y p y i s s u e s
● t y p e s h e d t r a c k e r
f o r i s s u e s w i t h s p e c i f i c m o d u l e s
● t y p i n g t r a c k e r
f o r d i s c u s s i o n o f n e w t y p e s y s t e m f e a t u r e s ( P E P 4 8 4 c h a n g e s ) a n d
r u n t i m e b u g s i n t h e t y p i n g m o d u l e
W h a t i s m y p y ?
M y p y i s a n o p t i o n a l s t a t i c t y p e c h e c k e r f o r P y t h o n . Y o u c a n a d d t y p e
h i n t s ( P E P 4 8 4 ) t o y o u r
P y t h o n p r o g r a m s , a n d u s e m y p y t o t y p e c h e c k t h e m s t a t i c a l l y .
F i n d b u g s i n y o u r p r o g r a m s w i t h o u t e v e n r u n n i n g t h e m !
Y o u c a n m i x d y n a m i c a n d s t a t i c t y p i n g i n y o u r p r o g r a m s . Y o u c a n a l w a y s
f a l l b a c k t o d y n a m i c t y p i n g w h e n s t a t i c t y p i n g i s n o t c o n v e n i e n t , s u c h
a s f o r l e g a c y c o d e .
H e r e i s a s m a l l e x a m p l e t o w h e t y o u r a p p e t i t e ( P y t h o n 3 ) :
from typing import Iterator
def fib (n : int ) -> Iterator [int ]:
a , b = 0 , 1
while a < n :
yield a
a , b = b , a + b
S e e t h e d o c u m e n t a t i o n f o r m o r e e x a m p l e s .
F o r P y t h o n 2 . 7 , t h e s t a n d a r d a n n o t a t i o n s a r e w r i t t e n a s c o m m e n t s :
def is_palindrome (s ):
# type: (str) -> bool
return s == s [::- 1 ]
S e e t h e d o c u m e n t a t i o n f o r P y t h o n 2 s u p p o r t .
M y p y i s i n d e v e l o p m e n t ; s o m e f e a t u r e s a r e m i s s i n g a n d t h e r e a r e b u g s .
S e e ' D e v e l o p m e n t s t a t u s ' b e l o w .
R e q u i r e m e n t s
Y o u n e e d P y t h o n 3 . 5 o r l a t e r t o r u n m y p y . Y o u c a n h a v e m u l t i p l e P y t h o n
v e r s i o n s ( 2 . x a n d 3 . x ) i n s t a l l e d o n t h e s a m e s y s t e m w i t h o u t p r o b l e m s .
I n U b u n t u , M i n t a n d D e b i a n y o u c a n i n s t a l l P y t h o n 3 l i k e t h i s :
$ sudo apt-get install python3 python3-pip
F o r o t h e r L i n u x f l a v o r s , m a c O S a n d W i n d o w s , p a c k a g e s a r e a v a i l a b l e a t
h t t p s : / / w w w . p y t h o n . o r g / g e t i t /
Q u i c k s t a r t
M y p y c a n b e i n s t a l l e d u s i n g p i p :
$ python3 -m pip install -U mypy
I f y o u w a n t t o r u n t h e l a t e s t v e r s i o n o f t h e c o d e , y o u c a n i n s t a l l f r o m g i t :
$ python3 -m pip install -U git+git://github.com/python/mypy.git
N o w , i f P y t h o n o n y o u r s y s t e m i s c o n f i g u r e d p r o p e r l y ( e l s e s e e
" T r o u b l e s h o o t i n g " b e l o w ) , y o u c a n t y p e - c h e c k t h e s t a t i c a l l y t y p e d p a r t s o f a
p r o g r a m l i k e t h i s :
$ mypy PROGRAM
Y o u c a n a l w a y s u s e a P y t h o n i n t e r p r e t e r t o r u n y o u r s t a t i c a l l y t y p e d
p r o g r a m s , e v e n i f t h e y h a v e t y p e e r r o r s :
$ python3 PROGRAM
Y o u c a n a l s o t r y m y p y i n a n o n l i n e p l a y g r o u n d ( d e v e l o p e d b y
Y u s u k e M i y a z a k i ) .
I D E , L i n t e r I n t e g r a t i o n s , a n d P r e - c o m m i t
M y p y c a n b e i n t e g r a t e d i n t o p o p u l a r I D E s :
● V i m :
● U s i n g S y n t a s t i c : i n ~ / . v i m r c a d d
l e t g : s y n t a s t i c _ p y t h o n _ c h e c k e r s = [ ' m y p y ' ]
● U s i n g A L E : s h o u l d b e e n a b l e d b y d e f a u l t w h e n m y p y i s i n s t a l l e d ,
o r c a n b e e x p l i c i t l y e n a b l e d b y a d d i n g l e t b : a l e _ l i n t e r s = [ ' m y p y ' ] in ~ / v i m / f t p l u g i n / p y t h o n . v i m
● E m a c s : u s i n g F l y c h e c k a n d F l y c h e c k - m y p y
● S u b l i m e T e x t : S u b l i m e L i n t e r - c o n t r i b - m y p y
● A t o m : l i n t e r - m y p y
● P y C h a r m : m y p y p l u g i n ( P y C h a r m i n t e g r a t e s
i t s o w n i m p l e m e n t a t i o n o f P E P 4 8 4 )
● V S C o d e : p r o v i d e s b a s i c i n t e g r a t i o n w i t h m y p y .
M y p y c a n a l s o b e s e t u p a s a p r e - c o m m i t h o o k u s i n g p r e - c o m m i t m i r r o r s - m y p y .
W e b s i t e a n d d o c u m e n t a t i o n
D o c u m e n t a t i o n a n d a d d i t i o n a l i n f o r m a t i o n i s a v a i l a b l e a t t h e w e b s i t e :
h t t p : / / w w w . m y p y - l a n g . o r g /
O r y o u c a n j u m p s t r a i g h t t o t h e d o c u m e n t a t i o n :
h t t p s : / / m y p y . r e a d t h e d o c s . i o /
T r o u b l e s h o o t i n g
D e p e n d i n g o n y o u r c o n f i g u r a t i o n , y o u m a y h a v e t o r u n p i p l i k e
t h i s :
$ python3 -m pip install -U mypy
T h i s s h o u l d a u t o m a t i c a l l y i n s t a l l t h e a p p r o p r i a t e v e r s i o n o f
m y p y ' s p a r s e r , t y p e d - a s t . I f f o r s o m e r e a s o n i t d o e s n o t , y o u
c a n i n s t a l l i t m a n u a l l y :
$ python3 -m pip install -U typed-ast
I f t h e m y p y c o m m a n d i s n ' t f o u n d a f t e r i n s t a l l a t i o n : A f t e r
p y t h o n 3 - m p i p i n s t a l l , t h e m y p y s c r i p t a n d
d e p e n d e n c i e s , i n c l u d i n g t h e t y p i n g m o d u l e , w i l l b e i n s t a l l e d t o
s y s t e m - d e p e n d e n t l o c a t i o n s . S o m e t i m e s t h e s c r i p t d i r e c t o r y w i l l n o t
b e i n P A T H , a n d y o u h a v e t o a d d t h e t a r g e t d i r e c t o r y t o P A T H
m a n u a l l y o r c r e a t e a s y m b o l i c l i n k t o t h e s c r i p t . I n p a r t i c u l a r , o n
m a c O S , t h e s c r i p t m a y b e i n s t a l l e d u n d e r / L i b r a r y / F r a m e w o r k s :
/Library/Frameworks/Python.framework/Versions/<version>/bin
I n W i n d o w s , t h e s c r i p t i s g e n e r a l l y i n s t a l l e d i n
\ P y t h o n N N \ S c r i p t s . S o , t y p e c h e c k a p r o g r a m l i k e t h i s ( r e p l a c e
\ P y t h o n 3 4 w i t h y o u r P y t h o n i n s t a l l a t i o n p a t h ) :
C:\>\Python34\python \Python34\Scripts\mypy PROGRAM
W o r k i n g w i t h v i r t u a l e n v
I f y o u a r e u s i n g v i r t u a l e n v ,
m a k e s u r e y o u a r e r u n n i n g a p y t h o n 3 e n v i r o n m e n t . I n s t a l l i n g v i a p i p 3
i n a v 2 e n v i r o n m e n t w i l l n o t c o n f i g u r e t h e e n v i r o n m e n t t o r u n i n s t a l l e d
m o d u l e s f r o m t h e c o m m a n d l i n e .
$ python3 -m pip install -U virtualenv
$ python3 -m virtualenv env
Q u i c k s t a r t f o r c o n t r i b u t i n g t o m y p y
I f y o u w a n t t o c o n t r i b u t e , f i r s t c l o n e t h e m y p y g i t r e p o s i t o r y :
$ git clone --recurse-submodules https://github.com/python/mypy.git
I f y o u ' v e a l r e a d y c l o n e d t h e r e p o w i t h o u t - - r e c u r s e - s u b m o d u l e s ,
y o u n e e d t o p u l l i n t h e t y p e s h e d r e p o a s f o l l o w s :
$ git submodule init
$ git submodule update
E i t h e r w a y y o u s h o u l d n o w h a v e a s u b d i r e c t o r y t y p e s h e d i n s i d e y o u r m y p y r e p o ,
y o u r f o l d e r s t r e e s h o u l d b e l i k e m y p y / m y p y / t y p e s h e d , c o n t a i n i n g a
c l o n e o f t h e t y p e s h e d r e p o ( h t t p s : / / g i t h u b . c o m / p y t h o n / t y p e s h e d ) .
F r o m t h e m y p y d i r e c t o r y , u s e p i p t o i n s t a l l m y p y :
$ cd mypy
$ python3 -m pip install -U .
R e p l a c e p y t h o n 3 w i t h y o u r P y t h o n 3 i n t e r p r e t e r . Y o u m a y h a v e t o d o
t h e a b o v e a s r o o t . F o r e x a m p l e , i n U b u n t u :
$ sudo python3 -m pip install -U .
N o w y o u c a n u s e t h e m y p y p r o g r a m j u s t a s a b o v e . I n c a s e o f t r o u b l e
s e e " T r o u b l e s h o o t i n g " a b o v e .
N O T E : I n s t a l l i n g w i t h s u d o c a n b e a s e c u r i t y r i s k , p l e a s e t r y w i t h f l a g - - u s e r f i r s t .
$ p y t h o n 3 - m p i p i n s t a l l - - u s e r - U .
W o r k i n g w i t h t h e g i t v e r s i o n o f m y p y
m y p y c o n t a i n s a s u b m o d u l e , " t y p e s h e d " . S e e h t t p s : / / g i t h u b . c o m / p y t h o n / t y p e s h e d .
T h i s s u b m o d u l e c o n t a i n s t y p e s f o r t h e P y t h o n s t a n d a r d l i b r a r y .
D u e t o t h e w a y g i t s u b m o d u l e s w o r k , y o u ' l l h a v e t o d o
git submodule update mypy/typeshed
w h e n e v e r y o u c h a n g e b r a n c h e s , m e r g e , r e b a s e , o r p u l l .
( I t ' s p o s s i b l e t o a u t o m a t e t h i s : S e a r c h G o o g l e f o r " g i t h o o k u p d a t e s u b m o d u l e " )
T e s t s
T h e b a s i c w a y t o r u n t e s t s :
$ pip3 install -r test-requirements.txt
$ python2 -m pip install -U typing
$ ./runtests.py
F o r m o r e o n t h e t e s t s , s u c h a s h o w t o w r i t e t e s t s a n d h o w t o c o n t r o l
w h i c h t e s t s t o r u n , s e e T e s t R E A D M E . m d .
D e v e l o p m e n t s t a t u s
M y p y i s b e t a s o f t w a r e , b u t i t h a s a l r e a d y b e e n u s e d i n p r o d u c t i o n
f o r s e v e r a l y e a r s a t D r o p b o x , a n d i t h a s a n e x t e n s i v e t e s t s u i t e .
S e e t h e r o a d m a p i f y o u a r e i n t e r e s t e d i n p l a n s f o r t h e
f u t u r e .
C h a n g e l o g
F o l l o w m y p y ' s u p d a t e s o n t h e b l o g : h t t p s : / / m y p y - l a n g . b l o g s p o t . c o m /
I s s u e t r a c k e r
P l e a s e r e p o r t a n y b u g s a n d e n h a n c e m e n t i d e a s u s i n g t h e m y p y i s s u e
t r a c k e r : h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / i s s u e s
I f y o u h a v e a n y q u e s t i o n s a b o u t u s i n g m y p y o r t y p e s , p l e a s e a s k
i n t h e t y p i n g g i t t e r i n s t e a d : h t t p s : / / g i t t e r . i m / p y t h o n / t y p i n g
C o m p i l e d v e r s i o n o f m y p y
W e h a v e b u i l t a c o m p i l e d v e r s i o n o f m y p y u s i n g t h e m y p y c
c o m p i l e r f o r
m y p y - a n n o t a t e d P y t h o n c o d e . I t i s a p p r o x i m a t e l y 4 t i m e s f a s t e r t h a n
i n t e r p r e t e d m y p y a n d i s a v a i l a b l e ( a n d t h e d e f a u l t ) f o r 6 4 - b i t
W i n d o w s , m a c O S , a n d L i n u x .
T o i n s t a l l a n i n t e r p r e t e d m y p y i n s t e a d , u s e :
$ python3 -m pip install --no-binary mypy -U mypy
I f y o u w i s h t o t e s t o u t t h e c o m p i l e d v e r s i o n o f a d e v e l o p m e n t
v e r s i o n o f m y p y , y o u c a n d i r e c t l y i n s t a l l a b i n a r y f r o m
h t t p s : / / g i t h u b . c o m / m y p y c / m y p y _ m y p y c - w h e e l s / r e l e a s e s / l a t e s t .
H e l p w a n t e d
A n y h e l p i n t e s t i n g , d e v e l o p m e n t , d o c u m e n t a t i o n a n d o t h e r t a s k s i s
h i g h l y a p p r e c i a t e d a n d u s e f u l t o t h e p r o j e c t . T h e r e a r e t a s k s f o r
c o n t r i b u t o r s o f a l l e x p e r i e n c e l e v e l s . I f y o u ' r e j u s t g e t t i n g s t a r t e d ,
a s k o n t h e g i t t e r c h a t f o r i d e a s o f g o o d
b e g i n n e r i s s u e s .
F o r m o r e d e t a i l s , s e e t h e f i l e C O N T R I B U T I N G . m d .
L i c e n s e
M y p y i s l i c e n s e d u n d e r t h e t e r m s o f t h e M I T L i c e n s e ( s e e t h e f i l e
L I C E N S E ) .
A b o u t
O p t i o n a l s t a t i c t y p i n g f o r P y t h o n 3 a n d 2 ( P E P 4 8 4 )
w w w . m y p y - l a n g . o r g /
T o p i c s
p y t h o n
t y p e s
t y p i n g
t y p e c h e c k e r
l i n t e r
R e s o u r c e s
R e a d m e
L i c e n s e
V i e w l i c e n s e
49
t a g s
+ 2 0 , 2 5 6
+ 3 9 5 c o n t r i b u t o r s
L a n g u a g e s
●
P y t h o n
9 5 . 8 %
●
C
3 . 0 %
●
P L S Q L
0 . 5 %
●
C + +
0 . 4 %
●
X S L T
0 . 2 %
●
S h e l l
0 . 1 %
● © 2 0 2 0 G i t H u b , I n c .
● T e r m s
● P r i v a c y
●
C o o k i e P r e f e r e n c e s
● S e c u r i t y
● S t a t u s
● H e l p
● C o n t a c t G i t H u b
● P r i c i n g
● A P I
● T r a i n i n g
● B l o g
● A b o u t
Y o u c a n ’ t p e r f o r m t h a t a c t i o n a t t h i s t i m e .
Y o u s i g n e d i n w i t h a n o t h e r t a b o r w i n d o w . R e l o a d t o r e f r e s h y o u r s e s s i o n .
Y o u s i g n e d o u t i n a n o t h e r t a b o r w i n d o w . R e l o a d t o r e f r e s h y o u r s e s s i o n .
W e u s e o p t i o n a l t h i r d - p a r t y a n a l y t i c s c o o k i e s t o u n d e r s t a n d h o w y o u u s e G i t H u b . c o m s o w e c a n b u i l d b e t t e r p r o d u c t s .
L e a r n m o r e .
A c c e p t
R e j e c t
W e u s e o p t i o n a l t h i r d - p a r t y a n a l y t i c s c o o k i e s t o u n d e r s t a n d h o w y o u u s e G i t H u b . c o m s o w e c a n b u i l d b e t t e r p r o d u c t s .
Y o u c a n a l w a y s u p d a t e y o u r s e l e c t i o n b y c l i c k i n g C o o k i e P r e f e r e n c e s a t t h e b o t t o m o f t h e p a g e .
F o r m o r e i n f o r m a t i o n , s e e o u r P r i v a c y S t a t e m e n t .
E s s e n t i a l c o o k i e s
W e u s e e s s e n t i a l c o o k i e s t o p e r f o r m e s s e n t i a l w e b s i t e f u n c t i o n s , e . g . t h e y ' r e u s e d t o l o g y o u i n .
L e a r n m o r e
A l w a y s a c t i v e
A n a l y t i c s c o o k i e s
W e u s e a n a l y t i c s c o o k i e s t o u n d e r s t a n d h o w y o u u s e o u r w e b s i t e s s o w e c a n m a k e t h e m b e t t e r , e . g . t h e y ' r e u s e d t o g a t h e r i n f o r m a t i o n a b o u t t h e p a g e s y o u v i s i t a n d h o w m a n y c l i c k s y o u n e e d t o a c c o m p l i s h a t a s k .
L e a r n m o r e
A c c e p t
R e j e c t
S a v e p r e f e r e n c e s