Commit Graph
6004 Commits
Author SHA1 Message Date
Jukka LehtosaloandJelle Zijlstra 84548f5bba Revert "fix list concatenation (#2404)" (#2653)
The fix caused regressions for mypy that are difficult to
fix.  See https://github.com/python/mypy/issues/5492 for
context.

This reverts commit 1a42a2c3ea.
2018-11-29 12:20:29 -08:00
Sebastian RittauandJelle Zijlstra ece96777a7 Re-export pyexpat instead of using check_consistency (#2649) 2018-11-29 07:29:59 -08:00
anentropicandSebastian Rittau 98e63d2d2f staticmethod and classmethod can wrap any callable (#2650)
Closes: #2645
2018-11-29 14:36:08 +01:00
Michael R. CrusoeandSebastian Rittau 48183b1d27 Unicode fixes for url2pathname() and pathname2url() (#2555) 2018-11-29 14:28:07 +01:00
Florian BruhinandSebastian Rittau f2e842b2d9 Fix handling of logging args (#2635)
* Use _ArgsType for logging.makeRecord
* The "args" argument is passed to LogMessage, so passing a tuple in is fine as
well.
* Use Mapping rather than Dict, see https://bugs.python.org/issue21172
2018-11-29 12:56:01 +01:00
Utkarsh GuptaandJelle Zijlstra 388de0876b threading.pyi: Add currentThread for all versions (#2647)
Fixes https://github.com/python/typeshed/issues/2625
2018-11-28 18:52:27 -08:00
jhanceandIvan Levkivskyi 5663dba895 [gflags] add known_only arg to __call__ (#2646) 2018-11-28 18:45:51 +00:00
Utkarsh GuptaandSebastian Rittau 03981de076 __init__.pyi: Fix dump() (#2640)
Fixes #2089
2018-11-28 09:08:30 +01:00
Florian BruhinandJelle Zijlstra 25c5f3cace yaml: Add __version__ attribute (#2636) 2018-11-27 20:56:01 -08:00
Brandt BucherandJelle Zijlstra 1857435e6f types.CodeType.co_filename isn't Optional. (#2639) 2018-11-27 20:53:05 -08:00
Guido van RossumandGitHub f9ba5402f8 Improve overloads of parse_args() -- it never returns None (#2643)
Fixes #2641
2018-11-27 18:11:30 -08:00
Maarten ter HuurneandSebastian Rittau eaae246062 Change argument type for xml.etree.ElementTree.iselement() to object (#2642)
It should be possible to ask for every object whether it looks like
an element. If only Elements are accepted, this function would always
return True.

Fixes #2629
2018-11-28 02:34:27 +01:00
Florian BruhinandSebastian Rittau 489180ffcc Add stubs for the faulthandler stdlib module (#2627) 2018-11-26 16:39:47 +01:00
Dave HalterandSebastian Rittau 96ed18f6e1 Add posix attributes for Python 3 (#2631)
The posix module in Python 3 lacks some attributes that are present in both
os/__init__.pyi and Python 2's posix.pyi
2018-11-26 14:39:12 +01:00
Joel RosdahlandSebastian Rittau 41d6a2791a Fix return type of datetime.datetime.dst (#2634)
Fixes #2633.
2018-11-26 14:35:23 +01:00
Dave HalterandSebastian Rittau 84daf7c93b Add __getnewargs__ to float, int, bool, str, bytes, unicode (#2632) 2018-11-26 10:43:12 +01:00
Keith GrayandSebastian Rittau 9c3978e337 Added cyaml.pyi (#2613)
Closes #1996
2018-11-24 18:13:14 +01:00
Maxim KurnikovandJelle Zijlstra 172b384e23 zipfile.ZipInfo.__init__ is the same on 2/3 (#2628) 2018-11-23 18:46:57 -08:00
Sebastian RittauandJelle Zijlstra 517d2b6012 Remove unneeded ignores (#2624) 2018-11-23 09:51:44 -08:00
Sebastian RittauandJelle Zijlstra 8c8dc5658f sudo is not required anymore (#2618) 2018-11-22 22:17:20 -08:00
Maxim KurnikovandSebastian Rittau 5ae8fbaa61 add __setattr__ to optparse.Values (#2622) 2018-11-22 20:37:51 +01:00
Matt GilsonandSebastian Rittau 8aa5feac57 Update types for requests.adapters (#2614) 2018-11-22 12:06:58 +01:00
Maxim KurnikovandSebastian Rittau 59040f08a6 Add some distutils.dist.Distribution attrs (#2620) 2018-11-22 11:24:47 +01:00
Maarten ter HuurneandSebastian Rittau 89b06c833d Add stub for pytz.VERSION (#2619) 2018-11-21 22:04:00 +01:00
Keith GrayandSebastian Rittau f9f4e50004 Added logging port constants to logging.handlers stub (#2617)
Closes #2616
2018-11-21 18:08:34 +01:00
Sebastian RittauandGitHub 36671663cc Accept upstream stubs when receiving no response (#2608)
Also, don't explicitly ask for people to ask for missing packages.

Closes #2573
2018-11-20 17:59:46 +01:00
Sebastian RittauandGitHub 82c59a7fc2 Merge Python 2 and 3 versions of itsdangerous (#2564) 2018-11-20 17:55:16 +01:00
Brandt BucherandSebastian Rittau 7685462672 Add complete annotations to builtins.compile. (#2606) 2018-11-20 17:48:24 +01:00
dgelessusandJelle Zijlstra 45d4e88175 Let ctypes._CData.from_buffer[_copy] accept any buffer object (#2610)
Fixes the issue discussed here:
https://github.com/python/typeshed/pull/1906#discussion_r234798828
2018-11-20 07:43:21 -08:00
Sebastian RittauandJelle Zijlstra cd75801aa5 Replace non-ellipsis default arguments (#2550) 2018-11-20 07:35:06 -08:00
Ruud van AsseldonkandSebastian Rittau b7d6bab83f Fix stub for SpooledTemporaryFile (#2452)
Fixes #2431
2018-11-20 11:03:21 +01:00
Diego Elio PettenòandSebastian Rittau e5b15b8eda Allow array[int] as a valid input to struct.unpack(). (#2586)
There does not seem to be an easy way to express that the array needs to be of a 1-byte type ('b', 'B', or 'c' in Python 2 only), so it is a bit more permissive than it should be.
2018-11-19 09:44:13 +01:00
Jakub StasiakandSebastian Rittau 9a92056105 Document the Python 3.7 variant of subprocess.check_output (#2592) 2018-11-19 09:41:05 +01:00
Summon528andSebastian Rittau 9c45638650 Fix return annotation for asyncio.as_completed() (#2600) 2018-11-19 09:35:22 +01:00
Matt GilsonandJelle Zijlstra b868c6c3c1 Relax type for click.echo. (#2607)
Fixes #2604
2018-11-18 19:25:11 -08:00
Brandt BucherandJelle Zijlstra b29b239f17 Add optimize parameter to builtins.compile. (#2605)
In Python 3, `builtins.compile` takes 6 arguments (`source`, `filename`, `mode`, `flags=0`, `dont_inherit=False`, `optimize=-1`). This change adds the last `optimize` parameter, which is new since Python 2.
2018-11-16 23:35:32 -08:00
dgelessusandSebastian Rittau 232b7c5147 Fix two small issues in ctypes.Array stubs (#2599)
* Allow only _CData subclasses as ctypes.Array elements

* Change type of ctypes.Array.raw and .value to Any (Closes #2111)

.raw and .value don't exist on all arrays. On c_char arrays, both exist
and have type bytes; on c_wchar arrays, only .value exists and has
type Text; on all other arrays neither one exists.

This is impossible to describe properly in a stub, so marking .value as
Any is the best that can be done.
2018-11-16 17:21:32 +01:00
Adam SimpkinsandSebastian Rittau c1dbdc7e26 Fix the return type for unittest.TestCase.run() (#2603)
In Python 3 this method returns None if the test is skipped, and a
TestResult otherwise.
2018-11-16 10:32:42 +01:00
Guido van RossumandJelle Zijlstra 4dc21f04dd Move Sized earlier in the bases of Sequence (#2602)
See https://github.com/rominf/ordered-set-stubs/issues/1:
class OrderedSet(MutableSet[T], Sequence[T]): ...
works in Python 3, but not in Python 2 -- this fixes that
2018-11-13 20:47:48 -08:00
Gregory P. SmithandSebastian Rittau 5d85326ad8 Expand Python 2's urllib.addbase definition. (#2601)
Give it enough information to determine that addinfourl
is iterable and that iteration and read methods return bytes.

Modeled after what is in stdlib/3/urllib/response.pyi after confirming
by looking at Python 2.7 stdlib code.
2018-11-13 11:04:12 +01:00
Gregory P. SmithandSebastian Rittau cd4572e43c Annotate some missing http client and urllib APIs. (#2582) 2018-11-12 21:54:57 +01:00
Dev AggarwalandSebastian Rittau c7b0e60032 Add missing stubs for multiprocessing.connection module. (#2596) 2018-11-11 16:54:11 +01:00
Peter PentchevandJelle Zijlstra f8e5222c46 unittest.TestCase.assertRaises(): BaseException (#2594)
In Python 3, just as in Python 2, the expected exception argument to
assertRaises() and assertRaisesRegex() must be a subtype of
BaseException, not just of Exception.

Closes #2593
2018-11-08 18:42:51 -08:00
Marco LeograndeandJelle Zijlstra e58a338d51 Fix typo in typing.pyi (#2595) 2018-11-08 18:41:53 -08:00
Jelle ZijlstraandIvan Levkivskyi 1a42a2c3ea fix list concatenation (#2404)
Fixes #2383, python/mypy#5492.
2018-11-08 06:42:57 -08:00
Pascal CorpetandSebastian Rittau c2ecb77ca5 Add options and extensions to google protobuf messages. (#2589) 2018-11-07 09:54:38 +01:00
Pascal CorpetandSebastian Rittau 23db1fc137 Strengthen typing of datetime methods of Google protobuf's Timestamp. (#2590) 2018-11-07 01:46:02 +01:00
Diego Elio PettenòandSebastian Rittau 0ebba82bfc Simplify base64 input and output parameters. (#2587)
This allows passing bytearray() objects to the base64 encode and decode functions, on both Python 2.7 and 3.4.

This also simplifies the code by ignoring 3.2 and 3.3, which are out of scope.
2018-11-06 19:24:16 +01:00
MatthewPScott81andSebastian Rittau 744f572c68 deque init() optional maxlen (#2585)
Closes #2581
2018-11-04 23:06:47 +01:00
edgchen1andSebastian Rittau 1989265e1f Make inspect.unwrap() stop argument optional. (#2583)
Closes #2574
2018-11-03 02:12:49 +01:00