Commit Graph

247 Commits

Author SHA1 Message Date
Ivan Levkivskyi
97737ce8c2 Add collections import in typing for type aliases to always work (#1456)
* Add collections import in typing for type aliases to always work

* Add mypy issue number to the comment
2017-07-03 10:01:19 -07:00
Ashwini Chaudhary
83d5ba157c Added stub for toaiff module (#1455) 2017-07-02 21:24:21 -07:00
Ashwini Chaudhary
489696e9a1 Added stub for user module (#1454) 2017-07-02 15:17:37 -07:00
Peter Vilim
bc9b2f0d4d Fix signature for slite3.fetchmany (#1444)
Also made pymssql.fetchmany simpler.
2017-06-29 15:05:47 -07:00
Roy Williams
ac87de50dd Add __name__ field to MethodType (#1442)
See 08c16016e2/Lib/types.py (L32-L34)

```python
>>> class _C:
...     def _m(self): pass
...
>>> _C()._m.__name__
'_m'
```
2017-06-29 10:05:25 -07:00
Roy Williams
31d7393cae Support calling eval and ast module with unicode in Python 2 (#1440) 2017-06-26 19:06:17 -07:00
mistermocha
5306d6f5a7 Correct implementation of standard types besides "object" (#1340)
Per https://github.com/python/mypy/issues/2989
2017-06-23 09:45:48 -07:00
Jelle Zijlstra
4a5ff0bb11 use PEP 526-style annotations in os stubs (#1428)
And fix some TODOs.

This will help me check these stubs with my stubcheck tool, and is better
for consistency anyway.
2017-06-22 05:49:23 -07:00
Matthias Kramm
c4e0580a4a make io.pyi import everything from _io.py(i), like io.py does (#1395)
* make io.pyi import _io.py(i), like io.py does
* make write/writelines take 'Any', on _IOBase
* Add missing constructors, fix inconsistencies.
* Also, as far as possible, try to simplify, by moving methods into base
classes.
* fix lint+mypy warnings
* add missing __enter__ methods
* make _IOBase inherit from BinaryIO
* make _TextIOBase not subclass _IOBase
2017-06-21 20:04:04 -07:00
Guido van Rossum
04fe184dcf Add flags to pass on --warn-unused-ignores and --no-implicit-optional to mypy (#1421)
* Add flags to pass on --warn-unused-ignores and --no-implicit-optional to mypy
* Make implicit Optional explicit in arg types (2and3 part)
* Convert {stdlib,third_party}/2 to explicit Optional
2017-06-20 22:18:49 -07:00
Guido van Rossum
86070643ac Improve csv module and float() signature (#1418)
* DictReader should not be abstract. Reformat long lines.
* Make restval optional for DictWriter.__init__.
* The arg to reader() is *Iterable*, not *Iterator*.
* Improve signature of float() (use Union instead of overload).
2017-06-20 13:04:10 -07:00
rchen152
945527dbc0 Add a __new__ method to datetime.datetime. (#1417) 2017-06-19 17:05:34 -07:00
Yusuke Miyazaki
1c8498228d Update stub for csv (#1398) 2017-06-15 16:35:17 -07:00
Matthias Kramm
5d1aacfed3 special-case overload for itertools.product with 'repeat' (#1410)
Add an additional overload for the `repeat = n` case. Since we don't know 
the numeric value of `repeat`, this just produces an iterator over an 
arbitrary-length tuple.
2017-06-15 19:13:46 +01:00
Guido van Rossum
4fbdcf5b03 Revert "add back 'repeat' argument to itertools.product (#1407)" (#1409)
This reverts commit d5e7663f93.
2017-06-14 13:10:29 -07:00
Matthias Kramm
d5e7663f93 add back 'repeat' argument to itertools.product (#1407)
Fixes a regression introduced by #1393.
2017-06-14 09:33:37 -07:00
Semyon Proshev
fed4e03e53 Add __new__ to str and int stubs in both Pythons. (#1352)
* Update default values to `...` in `__init__` and `__new__` in `int` and `str`.
* Add `__new__` to `enum.IntEnum` to override inherited `__new__`.
* Add `type: ignore` comment to `IntEnum`
2017-06-12 20:53:32 -07:00
Matthias Kramm
ed6dc176da make itertools.product more precise (#1393) 2017-06-12 20:10:08 -07:00
Matthias Kramm
d4c13e73f9 gzip.GzipFile.__init__ accepts any Text for 'mode' (#1403) 2017-06-12 15:36:47 -07:00
rchen152
16ec7cbdf0 Add __new__ to time.struct_time (#1394)
This is needed because otherwise pytype uses the `__new__` inherited from the `NamedTuple` base class.
2017-06-06 15:36:01 -07:00
pkordas
4dd40465e7 added stub file for popen2 (#1385) 2017-06-05 12:27:34 -07:00
amstree
1d4c73d708 Fix type annotations for glob (#1386) 2017-06-02 21:05:21 -07:00
amstree
66765c1fdb add glob1 glob0 to glob (#1368)
* add glob1 glob0 to glob

* add glob1 glob0 to python 3 stub

* fix types to take str and unicode

* Update glob.pyi
2017-06-02 11:22:07 -07:00
Cooper Lees
4656153478 Allow subprocess stdout + stderr be Optional (#1375)
- Adding optional to _FILE for stderr + stdout arguments to subprocess functions
- Sometimes you might want subprocess commands to be quiet and other time print the output
2017-06-01 17:46:14 -07:00
rchen152
2161f72990 time.mktime can take a struct_time or a tuple. (#1380) 2017-06-01 17:37:13 -07:00
Yusuke Miyazaki
35852bd687 Update stub for grp (#1373) 2017-06-01 17:36:32 -07:00
Yusuke Miyazaki
193e6885d4 Update stub for spwd (#1372)
Update stub for spwd

- Use `NamedTuple`
- Fix stub for Python 3
  - Some attributes are changed from Python 2
    - `sp_nam` -> `sp_namp`
    - `sp_pwd` -> `sp_pwdp`
2017-05-31 12:07:21 -07:00
Matthias Kramm
6f07424246 fix types in os.path (#1363)
In Python 2, doing
    os.path.join(u"foo", "bar")
is actually legal, and returns a unicode string.
Also os.path.relpath always returns the type of its first argument.

(The solution is not perfect -- e.g.
    os.path.join("a", "b", "c", "d", u"e")
will still result in a type error. )
2017-05-31 10:43:26 -07:00
Semyon Proshev
5db571a8f3 Update typing.MutableMapping.update stubs to allow keyword-only arguments (#1370) 2017-05-30 21:44:10 -07:00
Yusuke Miyazaki
40c6927cf0 Update stub for pwd (#1371) 2017-05-30 21:43:30 -07:00
DmitriyS
9f433a57f4 Fix type stubs in typing.pyi (#1263) 2017-05-28 13:13:20 -07:00
Semyon Proshev
f9872cafd8 Update collections and typing.NamedTuple (#1276)
* Update stubs for `collections` module in both Pythons.
* Update `typing.NamedTuple` stub to have `_source` attribute.
* Fix compatibility of `deque.index` signature with supertype `Sequence`
2017-05-27 15:01:40 -07:00
Matěj Cepl
6f0c929658 Fix unittest.main() parameters. (#1351) 2017-05-27 14:40:55 -07:00
Jelle Zijlstra
fefdf185c7 merge and complete linecache stubs (#1320) 2017-05-26 08:30:42 -07:00
Jelle Zijlstra
4f2dd0f446 remove unused type ignore flags (#1346)
Verified that none of those are necessary for pytype.
2017-05-26 08:28:51 -07:00
Jelle Zijlstra
875b02e374 complete and merge weakref stubs (#1343) 2017-05-24 20:35:16 -07:00
Eklavya Sharma
c1b7fc7020 datetime: Fix datetime.datetime.replace's stub. (#1347) 2017-05-24 19:42:27 -07:00
elmar bucher
579f25896b fix posix and win32 specific realpath path.pyi definition (PR 2) (#1345)
Fixes #1335.
2017-05-24 18:54:50 -07:00
Jelle Zijlstra
d9bf214203 merge pickle stubs into 2and3 (#1328)
Followup from #1321
2017-05-24 14:57:58 -07:00
Jelle Zijlstra
6fe7cdb1c3 merge 2and3 stubs for select (#1333)
There don't seem to be significant changes between Python 2 and 3. The Python 2
stub was much better, so I mostly built off of it.
2017-05-24 14:57:11 -07:00
Jelle Zijlstra
89f27742ca add re.template (#1330) 2017-05-24 14:07:31 -07:00
Jelle Zijlstra
c930e889ee merge 2 and 3 stubs for fileinput (#1319)
* merge 2 and 3 stubs for fileinput

Plus some minor fixes.

* pytype doesn't like generic type aliases
2017-05-24 07:58:56 -07:00
Jelle Zijlstra
cca81d864a complete doctest stub (#1315)
* complete doctest stub

And merge it into 2and3 (the old stubs were virtually empty).

* note things changed in 3.4

2.7 also had an undocumented and deprecated doctest.Tester class. I'm going to leave it out until somebody asks for it to be added.
2017-05-23 16:34:34 -07:00
Jelle Zijlstra
9ae9a9e741 merge Python 2 and 3 stubs for difflib (#1313)
These were already virtually identical.

I didn't review the stubs themselves for correctness. I'll make some changes after this
PR is in.
2017-05-23 15:01:30 -07:00
Jelle Zijlstra
1dda4ac105 merge python 2 and 3 stubs for calendar (#1310)
These are pretty much the same in the stdlib, except that TimeEncoding
got renamed to different_locale.
2017-05-23 12:47:24 -07:00
Jelle Zijlstra
3267e2396b Dummy thread improvements (#1309)
* dummy_thread improvements

- Complete the Python 3 stub
- Add a Python 2 stub. They're close enough that they should go into 2and3, but
  the module name changed so we can't do that.

* fix my bugs
2017-05-23 12:46:42 -07:00
Jelle Zijlstra
915a91f80d fix "isisgeneratorfunction" (#1301) 2017-05-23 09:51:54 -07:00
Jelle Zijlstra
764d949f04 make _ast.identifier private (#1307)
It doesn't exist at runtime.
2017-05-23 09:51:29 -07:00
Daniel Li
787e423468 Annotate textwrap.dedent (#1295) 2017-05-22 15:53:04 -07:00
Emily Morehouse
adae702fc1 Moves pdb stub to 2and3 (#1294)
- Moves the pdb stub from separate `2`/`3` files to a single file in `2and3`, as they were identical.
- Maintains the comment header, as the stub is incomplete.
2017-05-22 15:48:14 -07:00