@@ -148,17 +148,19 @@ that you know.
148
148
The below is an excerpt from the types for the ` datetime ` module.
149
149
150
150
``` python
151
- MAXYEAR = ... # type : int
152
- MINYEAR = ... # type : int
151
+ MAXYEAR : int
152
+ MINYEAR : int
153
153
154
- class date ( object ) :
154
+ class date :
155
155
def __init__ (self , year : int , month : int , day : int ) -> None : ...
156
156
@ classmethod
157
157
def fromtimestamp (cls , timestamp : float ) -> date: ...
158
158
@ classmethod
159
159
def today (cls ) -> date: ...
160
160
@ classmethod
161
161
def fromordinal (cls , ordinal : int ) -> date: ...
162
+ @ property
163
+ def year (self ) -> int : ...
162
164
def replace (self , year : int = ... , month : int = ... , day : int = ... ) -> date: ...
163
165
def ctime (self ) -> str : ...
164
166
def weekday (self ) -> int : ...
@@ -183,6 +185,8 @@ rule is that they should be as concise as possible. Specifically:
183
185
* use a single blank line between top-level class definitions, or none
184
186
if the classes are very small;
185
187
* do not use docstrings;
188
+ * use variable annotations instead of type comments, even for stubs
189
+ that target older versions of Python;
186
190
* for arguments with a type and a default, use spaces around the ` = ` .
187
191
188
192
Stub files should only contain information necessary for the type
0 commit comments