README: move syntax example upwards

This commit is contained in:
Matthias Kramm
2015-09-17 09:21:18 -07:00
parent 771c209b95
commit 6f667fc1d5

View File

@@ -16,6 +16,30 @@ are used to describe the types the function has.
See [PEP 484](http://www.python.org/dev/peps/pep-0484/) for the exact syntax
of the stub files.
## Syntax example
The below is an excerpt from the types for the `datetime` module.
```
MAXYEAR = ... # type: int
MINYEAR = ... # type: int
__doc__ = ... # type: str
__file__ = ... # type: str
__name__ = ... # type: str
__package__ = ... # type: None
class date(object):
def __init__(self, year: int, month: int, day: int): ...
@classmethod
def fromtimestamp(cls, timestamp: int or float) -> date: ...
@classmethod
def fromordinal(cls, ordinal: int) -> date: ...
@classmethod
def today(self) -> date: ...
def ctime(self) -> str: ...
def weekday(self) -> int: ...
```
## Directory structure
### Builtins vs stdlib
@@ -63,30 +87,6 @@ stdlib/2.7/ | Standard library stubs for Python 2.7
... | ...
stdlib/2.7.6/ | Standard library stubs specialized for Python 2.7.6
## Example
The below is an excerpt from the types for the `datetime` module.
```
MAXYEAR = ... # type: int
MINYEAR = ... # type: int
__doc__ = ... # type: str
__file__ = ... # type: str
__name__ = ... # type: str
__package__ = ... # type: None
class date(object):
def __init__(self, year: int, month: int, day: int): ...
@classmethod
def fromtimestamp(cls, timestamp: int or float) -> date: ...
@classmethod
def fromordinal(cls, ordinal: int) -> date: ...
@classmethod
def today(self) -> date: ...
def ctime(self) -> str: ...
def weekday(self) -> int: ...
```
## Contributions
We're welcoming contributions (pull requests) for types of third party