Yusuke Miyazaki
6192cce9d9
Avoid using string literals in type annotations ( #2294 )
2018-07-02 20:23:29 -07:00
Sebastian Rittau
b05e99297c
Drop Python 3.3 support from several stubs ( #2266 )
...
* Drop Python 3.3 support from importlib stubs
* Drop Python 3.3 support from html and symbol stubs
2018-06-20 16:46:11 -07:00
Jelle Zijlstra
00cda79cf5
add io.TextIOWrapper.read in 3.3 ( #2248 )
...
This is needed to make TextIOWrapper and a few classes that inherit
from it concrete in 3.3. I am actually not sure whether this method
exists at runtime; there's nothing in
https://docs.python.org/3/library/io.html#io.TextIOWrapper
that suggests it was added in 3.4. In any case, it hardly matters
since 3.3 usage should be very rare now.
2018-06-17 23:47:07 +01:00
Jelle Zijlstra
6bbf3d89eb
Further improve codecs stubs ( #2217 )
...
- remove header comments
- uppercase type aliases
- remove old-style type annotations
- unquote forward refs
- reformat the file
- remove values for globals
- don't use private names from codecs stub in io.pyi
2018-06-11 22:24:34 -07:00
Jelle Zijlstra
37aba00fe8
fix using ZipFile as a ContextManager ( #2043 )
2018-04-12 12:29:22 -07:00
Sebastian Rittau
6d7173b70b
Add StringIO.name and BytesIO.name ( #1802 )
...
Also, change the type of StringIO.name (Python 3) from str to Any.
Neither StringIO nor BytesIO actually define a name field, but the
super-class IO[T] of both in typeshed does define a read-only property.
This means that sub-classes of StringIO and BytesIO adding this field
will not typecheck correctly.
Closes : #1790
2018-01-26 14:34:06 -08:00
rchen152
f6b60cb3ea
A couple fixes to the io stubs. ( #1811 )
...
1. The 'name' argument to FileIO.init can be either a string or an integer: https://docs.python.org/2/library/io.html#io.FileIO
2. An mmap.mmap object can be used in most places that a bytearray can: https://docs.python.org/3.5/library/mmap.html
2018-01-04 16:14:38 -08:00
Jelle Zijlstra
54dd6ba27c
Change numerous default values to ... ( #1722 )
...
This is the convention, and some default values (e.g. strings) apparently
break pytype.
2017-11-09 06:28:40 -08:00
Jelle Zijlstra
eaf8972e48
complete Python 3 gzip stub ( #1723 )
...
* complete python 3 gzip stub
* IOBase.closed is read-only
2017-11-09 05:56:55 -08:00
Evan Krall
9db63fee91
Make IOBase.__enter__ return the same type as self. Fixes #1540 . ( #1541 )
2017-08-11 16:06:07 -07:00
Jelle Zijlstra
32d9c8cb8f
make io.IncrementalNewlineDecoder concrete ( #1489 )
...
Part of #1476
2017-07-19 20:28:25 +03:00
Jelle Zijlstra
ac651d2f8c
Fix a few TODOs ( #1487 )
...
* fix some easy TODOs
* fix io
2017-07-19 20:27:50 +03:00
Guido van Rossum
350563223f
Add Optional[] for all remaining cases of x: <type> = None ( #1424 )
...
* Final round of adding Optional[] to type of arguments with default = None
* Update Travis to use --no-implicit-optionals and clarify CONTRIBUTING.md
2017-06-21 10:50:21 -07:00
Yusuke Miyazaki
c19e266dcf
Fix StringIO stub for Python 3 ( #1275 )
2017-05-19 17:02:57 -07:00
David Euresti
1260d41cd1
Fix type of IO.writelines. ( #949 )
...
This lets you use generators to writelines
2017-02-21 14:25:00 -08:00
Lukasz Langa
147772950f
Fixing flake8 E265 errors
2016-12-20 00:16:44 -08:00
Lukasz Langa
6b5c6626d6
Fixing flake8 E121, E122, E123, E124, E125, E126 errors
2016-12-19 23:53:19 -08:00
Lukasz Langa
fe0e3744cc
Fixing flake8 E261 errors
2016-12-19 22:09:35 -08:00
Eklavya Sharma
7f7a5789bd
Add attribute 'name' to StringIO ( #600 )
...
Add an attribute 'name' of type str to StringIO.StringIO in python2
and io.StringIO in python2 and python3.
Fixes #598 .
2016-10-12 07:34:58 -07:00
Guido van Rossum
39325bf159
Mypy now supports sys.platform and sys.version_info checks ( #410 )
2016-07-27 13:25:29 -07:00
Jukka Lehtosalo
e05edb60f1
Mypy stub fixes for strict optional mode ( #366 )
2016-07-13 09:38:40 -07:00
Valérian Rousset
e9efb31aa7
fix integration of io with mypy ( #196 )
2016-05-12 16:52:36 -07:00
Valérian Rousset
9fdac6e0df
improve io ( #194 )
...
* added types to io, some version-specific variants
* remove _io (moved the classes to io)
* remove internal, unused xml.etree._ListDataStream
2016-05-11 10:47:24 -07:00
David Fisher
44d278045f
Fix tests
2016-03-11 16:33:02 -08:00
Matthias Kramm
94c9ce8fd0
Consistently use '= ...' for optional parameters.
2015-11-09 13:55:02 -08:00
Matthias Kramm
4fe8915d44
Add missing '-> None' to all __init__ methods.
2015-11-09 10:25:11 -08:00
Matthias Kramm
337abed05a
add (overwrite with) mypy stubs, if available
2015-09-30 09:59:44 -07:00