Aug
SEP
Oct
27
2023
2024
2025
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 4 0 9 2 7 1 0 3 6 1 2 / 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
N a v i g a t i o n M e n u
●
A c t i o n s
A u t o m a t e a n y w o r k f l o w
P a c k a g e s
H o s t a n d m a n a g e p a c k a g e s
S e c u r i t y
F i n d a n d f i x v u l n e r a b i l i t i e s
C o d e s p a c e s
I n s t a n t d e v e n v i r o n m e n t s
G i t H u b C o p i l o t
W r i t e b e t t e r c o d e w i t h A I
C o d e r e v i e w
M a n a g e c o d e c h a n g e s
I s s u e s
P l a n a n d t r a c k w o r k
D i s c u s s i o n s
C o l l a b o r a t e o u t s i d e o f c o d e
E x p l o r e
●
●
●
●
●
B y s i z e
●
●
●
B y i n d u s t r y
●
●
●
B y u s e c a s e
●
●
●
●
T o p i c s
●
●
●
●
●
E x p l o r e
●
●
●
●
●
G i t H u b S p o n s o r s
F u n d o p e n s o u r c e d e v e l o p e r s
T h e R e a d M E P r o j e c t
G i t H u b c o m m u n i t y a r t i c l e s
R e p o s i t o r i e s
●
●
●
●
E n t e r p r i s e p l a t f o r m
A I - p o w e r e d d e v e l o p e r p l a t f o r m
A v a i l a b l e a d d - o n s
A d v a n c e d S e c u r i t y
E n t e r p r i s e - g r a d e s e c u r i t y f e a t u r e s
G i t H u b C o p i l o t
E n t e r p r i s e - g r a d e A I f e a t u r e s
P r e m i u m S u p p o r t
E n t e r p r i s e - g r a d e 2 4 / 7 s u p p o r t
●
S e a r c h o r j u m p t o . . .
Clear
S e a r c h s y n t a x t i p s
P r o v i d e f e e d b a c k
Include my email address so I can be contacted
C a n c e l
S u b m i t f e e d b a c k
S a v e d s e a r c h e s
U s e s a v e d s e a r c h e s t o f i l t e r y o u r r e s u l t s m o r e q u i c k l y
Query
To see all available qualifiers, see our documentation .
C a n c e l
C r e a t e s a v e d s e a r c h
f o c u s
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 .
Y o u s w i t c h e d a c c o u n t s o 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 .
D i s m i s s a l e r t
{ { m e s s a g e } }
p y t h o n
/
m y p y
P u b l i c
●
N o t i f i c a t i o n s
Y o u m u s t b e s i g n e d i n t o c h a n g e n o t i f i c a t i o n s e t t i n g s
●
F o r k
2 . 8 k
S t a r
1 8 . 3 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
w w w . m y p y - l a n g . o r g /
L i c e n s e
V i e w l i c e n s e
1 8 . 3 k
s t a r s
2 . 8 k
f o r k s
B r a n c h e s
T a g s
A c t i v i t y
S t a r
N o t i f i c a t i o n s
Y o u m u s t b e s i g n e d i n t o c h a n g e n o t i f i c a t i o n s e t t i n g s
●
C o d e
●
I s s u e s
2 . 7 k
●
P u l l r e q u e s t s
2 5 1
●
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
A d d i t i o n a l n a v i g a t i o n o p t i o n s
●
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
p y t h o n / m y p y
T h i s c o m m i t d o e s n o t b e l o n g t o a n y b r a n c h o n t h i s r e p o s i t o r y , a n d m a y b e l o n g t o a f o r k o u t s i d e o f t h e r e p o s i t o r y .
m a s t e r
B r a n c h e s T a g s
G o t o f i l e
C o d e
F o l d e r s a n d f i l e s
Name Name
Last commit message
Last commit date
Latest commit
History
11,998 Commits
View all files
R e p o s i t o r y f i l e s n a v i g a t i o n
● R E A D M E
● C o d e o f c o n d u c t
● L i c e n s e
● S e c u r i t y
M y p y : 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 ?
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 ! H e r e a r e s o m e g o o d p l a c e s t o a s k t h e m :
● f o r a n y t h i n g y o u ' r e c u r i o u s a b o u t , t r y g i t t e r c h a t
● f o r g e n e r a l q u e s t i o n s a b o u t P y t h o n t y p i n g , t r y t y p i n g d i s c u s s i o n 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 ,
t h e d o c u m e n t a t i o n
a n d t y p e h i n t s c h e a t s h e e t
c a n a l s o h e l p a n s w e r q u e s t i o n s .
I f y o u t h i n k y o u ' v e f o u n d a b u g :
● c h e c k o u r c o m m o n i s s u e s p a g e
● s e a r c h o u r i s s u e t r a c k e r t o s e e i f
i t ' s a l r e a d y b e e n r e p o r t e d
● c o n s i d e r a s k i n g o n g i t t e r c h a t
T o r e p o r t a b u g o r r e q u e s t a n e n h a n c e m e n t :
● r e p o r t a t o u r i s s u e t r a c k e r
● i f t h e i s s u e i s w i t h a s p e c i f i c l i b r a r y o r f u n c t i o n , c o n s i d e r r e p o r t i n g i t a t
t y p e s h e d t r a c k e r o r t h e i s s u e
t r a c k e r f o r t h a t l i b r a r y
T o d i s c u s s a n e w t y p e s y s t e m f e a t u r e :
● d i s c u s s a t d i s c u s s . p y t h o n . o r g
● t h e r e i s a l s o s o m e h i s t o r i c a l d i s c u s s i o n a t t h e t y p i n g - s i g m a i l i n g l i s t a n d t h e p y t h o n / t y p i n g r e p o
W h a t i s m y p y ?
M y p y i s a 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 .
T y p e c h e c k e r s h e l p e n s u r e t h a t y o u ' r e u s i n g v a r i a b l e s a n d f u n c t i o n s i n y o u r c o d e
c o r r e c t l y . W i t h m y p y , 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 m y p y w i l l w a r n y o u w h e n y o u u s e t h o s e t y p e s
i n c o r r e c t l y .
P y t h o n i s a d y n a m i c l a n g u a g e , s o u s u a l l y y o u ' l l o n l y s e e e r r o r s i n y o u r c o d e
w h e n y o u a t t e m p t t o r u n i t . M y p y i s a s t a t i c c h e c k e r , s o i t f i n d s 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 !
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 :
number = input ("What is your favourite number?" )
print ("It is" , number + 1 ) # error: Unsupported operand types for + ("str" and "int")
A d d i n g t y p e h i n t s f o r m y p y d o e s n o t i n t e r f e r e w i t h t h e w a y y o u r p r o g r a m w o u l d
o t h e r w i s e r u n . T h i n k o f t y p e h i n t s a s s i m i l a r t o c o m m e n t s ! Y o u c a n a l w a y s u s e
t h e 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 c o d e , e v e n i f m y p y r e p o r t s e r r o r s .
M y p y i s d e s i g n e d w i t h g r a d u a l t y p i n g i n m i n d . T h i s m e a n s y o u c a n a d d t y p e
h i n t s t o y o u r c o d e b a s e s l o w l y a n d t h a t 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 .
M y p y h a s a p o w e r f u l a n d e a s y - t o - u s e t y p e s y s t e m , s u p p o r t i n g f e a t u r e s s u c h a s
t y p e i n f e r e n c e , g e n e r i c s , c a l l a b l e t y p e s , t u p l e t y p e s , u n i o n t y p e s ,
s t r u c t u r a l s u b t y p i n g a n d m o r e . U s i n g m y p y w i l l m a k e y o u r p r o g r a m s e a s i e r t o
u n d e r s t a n d , d e b u g , a n d m a i n t a i n .
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 a n d i n f o r m a t i o n .
I n p a r t i c u l a r , s e e :
● t y p e h i n t s c h e a t s h e e t
● g e t t i n g s t a r t e d
● l i s t o f e r r o r c o d e s
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 t h e
r e p o d i r e c t l y :
python3 -m pip install -U git+https://github.com/python/mypy.git
# or if you don't have 'git' installed
python3 -m pip install -U https://github.com/python/mypy/zipball/master
N 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 t h e 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 m y p y r e p o r t s 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 f y o u a r e w o r k i n g w i t h l a r g e c o d e b a s e s , y o u c a n r u n m y p y i n
d a e m o n m o d e , t h a t w i l l g i v e m u c h f a s t e r ( o f t e n s u b - s e c o n d ) i n c r e m e n t a l u p d a t e s :
dmypy run -- PROGRAM
I n t e g r a t i o n s
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
● 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 of 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 .
● p r e - c o m m i t : u s e 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
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 s : / / w w w . m y p y - l a n g . o r g /
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 /
F o l l o w a l o n g o u r c h a n g e l o g a t :
h t t p s : / / m y p y - l a n g . b l o g s p o t . c o m /
C o n t r i b u t i n g
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 .
T o g e t s t a r t e d w i t h d e v e l o p i n g m y p y , s e e C O N T R I B U T I N G . m d .
I f y o u n e e d h e l p g e t t i n g s t a r t e d , d o n ' t h e s i t a t e t o a s k o n g i t t e r .
M y p y c a n d c o m p i l e d v e r s i o n o f m y p y
M y p y c u s e s P y t h o n t y p e h i n t s t o c o m p i l e P y t h o n
m o d u l e s t o f a s t e r C e x t e n s i o n s . M y p y i s i t s e l f c o m p i l e d u s i n g m y p y c : t h i s m a k e s
m y p y 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 f i n t e r p r e t e d !
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
T o u s e a 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 , 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 .
T o c o n t r i b u t e t o t h e m y p y c p r o j e c t , c h e c k o u t h t t p s : / / g i t h u b . c o m / m y p y c / m y p y c
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
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 c h e c k e r
t y p e s
l i n t e r
t y p i n g
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
C o d e o f c o n d u c t
C o d e o f c o n d u c t
S e c u r i t y p o l i c y
S e c u r i t y p o l i c y
A c t i v i t y
C u s t o m p r o p e r t i e s
S t a r s
1 8 . 3 k
s t a r s
W a t c h e r s
2 3 9
w a t c h i n g
F o r k s
2 . 8 k
f o r k s
R e p o r t r e p o s i t o r y
94
t a g s
S p o n s o r t h i s p r o j e c t
●
h t t p s : / / w w w . p y t h o n . o r g / p s f / d o n a t i o n s / p y t h o n - d e v /
L e a r n m o r e a b o u t G i t H u b S p o n s o r s
+ 2 4 7 , 5 9 0
+ 6 8 4 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 . 5 %
●
C
3 . 2 %
●
C + +
1 . 1 %
●
X S L T
0 . 1 %
●
S h e l l
0 . 1 %
●
C S S
0 . 0 %
F o o t e r
© 2 0 2 4 G i t H u b , I n c .
●
T e r m s
●
P r i v a c y
●
S e c u r i t y
●
S t a t u s
●
D o c s
●
C o n t a c t
●
M a n a g e c o o k i e s
●
D o n o t s h a r e m y p e r s o n a l i n f o r m a t i o n
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 .