The Wayback Machine - https://web.archive.org/web/20201104211112/https://github.com/refi64/typeshed
Skip to content
master
Go to file
Code
This branch is 3912 commits behind python:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

typeshed

About

Typeshed models function types for the Python standard library and Python builtins.

This data can e.g. be used for static analysis, type checking or type inference.

Format

Each Python module is represented by a .py "stub". This is a normal Python file (i.e., it can be interpreted by Python 3), except all the methods are empty. Python function annotations (PEP 3107) are used to describe the types the function has. See (PEP 484) for the exact syntax of the stub files.

Example

The below is an excerpt from the types for the datetime module.

MAXYEAR = Undefined(int)
MINYEAR = Undefined(int)
__doc__ = Undefined(str)
__file__ = Undefined(str)
__name__ = Undefined(str)
__package__ = Undefined(None)

class date(object):
    def __init__(self, year: int, month: int, day: int): pass
    @classmethod
    def fromtimestamp(cls, timestamp: int or float) -> date: pass
    @classmethod
    def fromordinal(cls, ordinal: int) -> date: pass
    @classmethod
    def today(self) -> date: pass
    def ctime(self) -> str: pass
    def weekday(self) -> int: pass

About

Collection of library stubs for Python, with static types

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.