Евгений
6f09ccb63d
logging: inherit TimedRotatingFileHandler from Handler ( #2738 )
2019-01-17 13:54:59 +01:00
Michael R. Shannon
a2ecfafa98
Add missing explicit Optional to stubs for the xml.etree package. ( #2734 )
...
Fixes #2733
2019-01-17 13:50:37 +01:00
Michael Noseworthy
e8c1111d13
Fix logging.getLevelName() type hints ( #2730 )
...
`logging.getLevelName()` can take either an `int` and returns a `str` or
a `str` and returns an `int` when the level name (`str`) or level
(`int`) is one of the registered log levels. If the value passed in
isn't one of the registered log levels, it returns the string `"level
%s" % lvl` where `lvl` is the value passed in to the function.
2019-01-17 13:40:03 +01:00
Jelle Zijlstra
78690405cf
add back StopIteration.value in Python 3 ( #2744 )
...
Fixes python/mypy#6209 .
2019-01-16 19:21:16 -08:00
Igor Davydenko
8e6e178a5a
As of Python 3.6 dump_stats method allows PathLike object to be passed. ( #2741 )
...
Replicate typings from `pstats.dump_stats` into `profile` and `cProfile`
libraries.
2019-01-15 10:27:53 -08:00
cormoran
632eadc894
Make metavar in argparse be Optional ( #2739 )
2019-01-13 12:09:06 +01:00
Vield
ee20595996
Fix type of indent in JSONEncoder ( #2737 )
...
A None value for indent means the most compact representation (no newlines), it is also the default value.
2019-01-11 12:48:21 +01:00
Michael J. Sullivan
f343150a6d
Make ZipFile.NameToInfo use Text as the key type ( #2736 )
...
This makes it match ZipInfo.filename and also actual behavior.
2019-01-10 20:32:18 -06:00
Michael J. Sullivan
c75d42ef23
Fix the type of ord on python 2 ( #2735 )
...
It looks like it got messed up in #2533
2019-01-10 19:24:51 -06:00
Tomer Keren
be99a2a5f0
Use a more accurate type for predicates in itertools ( #2732 )
...
The only constraint on the return value of a predicate is to be "boolable".
Because `bool` recives an object in the constructor https://github.com/python/typeshed/blob/master/stdlib/2and3/builtins.pyi#L803 this is a more accurate description of a predicate.
2019-01-10 11:30:28 -08:00
Hynek Schlawack
0854df365d
Add SSLCertVerificationError for 3.7+ ( #2729 )
...
As of 3.7, ssl.CertificateError became an alias for the new
SSLCertVerificationError.
2019-01-09 09:17:39 +01:00
Alexander Lyon
2ea8abc1c7
Update sqlite3 types to include extensions ( #2728 )
2019-01-08 16:31:11 +01:00
Ethan Smith
ad304cb9ee
Use overlapped signatures of _winapi functions ( #2723 )
...
For python/mypy#6148
2019-01-07 11:39:26 +01:00
Savo Kovačević
eb6dbe510d
Fix unittest.TestCase assert methods' argument names ( #2724 )
...
And fix assertNotAlmostEqual overloads
2019-01-05 17:31:32 -08:00
Alex Sarkesian
893089d143
Add stubs to classes in zipfile to better enable subclassing ( #2707 )
2019-01-05 10:43:26 -08:00
Ilya Konstantinov
93150dc0fa
LoggerAdapter.log argument lvl -> level ( #2722 )
2019-01-04 09:03:56 +01:00
Diogo Magalhães Martins
f4aed1fd40
Fixing type for asyncio.StreamWriter reader init parameter ( #2719 )
...
Closes #2718
2018-12-28 17:56:38 +01:00
Tomer Keren
d9a202e352
Make appropriate ast methods generic ( #2715 )
...
Closes #2714
2018-12-24 20:03:09 +01:00
Savo Kovačević
8542916231
Add missing currentframe to logging module ( #2712 )
2018-12-23 19:57:15 +01:00
Sebastian Rittau
eb1788ac39
Merge Python 2 and 3 builtins.pyi ( #2533 )
2018-12-21 07:12:41 -08:00
Juan Gonzalez
76a334daeb
Complete unittest.TextTestResult stubs ( #2700 )
2018-12-21 08:37:33 +01:00
Dave Halter
2cedbc7d63
Add missing attributes of type ( #2544 )
...
All these attributes can be seen when using `dir(type)`.
In the future we should be discussing if certain methods on object (like
__eq__) should really be there. IMO this should be defined on type where it
actually also appears when using `dir`.
2018-12-20 20:01:40 -08:00
Ville Skyttä
9b5976e15b
socket: Some more address typing ( #2695 )
2018-12-20 19:45:29 -08:00
Daniel Mouritzen
fb8b77e715
Set correct type for _subparsersaction.choices ( #2702 )
...
choices=_name_parser_map, see a11d44056e/Lib/argparse.py (L1097)
2018-12-20 19:44:30 -08:00
Juan Gonzalez
c18b75b2e6
Make mypy aware of IMapUnorderedIterator ( #2701 )
2018-12-20 19:41:58 -08:00
Jelle Zijlstra
46ab77eb20
loop argument to asyncio.ensure_future is Optional ( #2708 )
...
The default value is None: https://github.com/python/cpython/blob/master/Lib/asyncio/tasks.py#L616 .
2018-12-20 15:24:03 -08:00
Ville Skyttä
0956a24eb2
bytes/bytearray.startswith fixes ( #2696 )
2018-12-17 18:57:07 +01:00
Kai Willadsen
4d85e5365f
Add missing ENOTSUP alias to errno ( #2692 )
2018-12-17 17:46:32 +01:00
Philipp Hahn
bf410fb9ef
Logging ( #2687 )
...
* logging: Add logging.Logger().fatal()
fatal() is an alias for critical(): It is just another name for the same
implementation.
* logging: Fix logging.Logger().warn()
warn() was an alias for warning(), but got deprecated with Python3.
In Python2 warn() is just another name for the same method.
In Python3 they have their own implementations, which adds a deprecation
warning before calling the new function.
PS: LoggerAdapter in Python2 never has the warn() method, but Python3
still implements the deprecation wrapper function.
2018-12-17 15:39:01 +01:00
Dave Halter
5c69373890
macpath, os/path, posixpath and ntpath should basically be the same files ( #2637 )
2018-12-17 15:02:18 +01:00
gnattishness
ea0dbfa313
Fix typo for Message.add_attachment in message.pyi ( #2697 )
2018-12-15 19:11:15 -08:00
Michael J. Sullivan
95afb86022
Move posix.stat_result to os.stat_result on python 3 ( #2683 )
...
In python 3, posix.stat_result is a re-export of os.stat_result, while
in python 2 it was the reverse. Update typeshed to reflect this.
2018-12-13 19:20:42 +01:00
Andrew Svetlov
b9be76c255
Task.current_task() and Task.all_tasks() have an optional loop parameter ( #2690 )
2018-12-12 13:18:18 -08:00
Philipp Hahn
d57e8c69f3
urllib2: timeout: int -> Optional[float] ( #2685 )
2018-12-12 15:47:53 +01:00
Kostya Esmukov
2469a3ccda
Fix signature of ConfigParser's dict_type argument ( #2684 )
2018-12-12 08:22:31 +01:00
Sander Voerman
1b24d80087
Add get_loop() to asyncio.Future [Python 3.7] ( #2680 )
2018-12-09 21:37:37 +01:00
Brandt Bucher
0b49ce75b4
Add contextlib.nullcontext [Python 3.7]. ( #2677 )
...
Closes #2676
2018-12-08 02:55:47 +01:00
Utkarsh Gupta
b3ced5b8c0
decimal.pyi: Add overload for Decimal.__round__() ( #2674 )
...
Fixes #2528
2018-12-07 10:00:24 +01:00
Guido van Rossum
e08a5ac367
Tweak how ast.pyi imports typing ( #2668 )
...
When we import typeshed internally at Dropbox, somehow the fact that
these files are all stubs gets lost (it's a long story...). This
causes errors like this:
.../stdlib/2/ast.pyi:6: error: Name 'typing' already defined (by an import)
The quickest way around this is to rename the import to _typing.
2018-12-04 17:25:23 +01:00
Utkarsh Gupta
3e4737c683
ast.pyi: Fix return type of generic_visit() ( #2667 )
...
Fixes #2085
2018-12-04 08:02:39 +01:00
Brandt Bucher
ac8f5da324
Replace Loader with PEP 451 _Loader protocol in _importlib_modulespec.pyi annotations. ( #2626 )
2018-12-03 21:26:37 +01:00
Utkarsh Gupta
bee236fb5d
builtins.pyi: Return complex from __(r)pow__() ( #2662 )
...
Closes #1406
2018-12-03 14:21:27 +01:00
Utkarsh Gupta
9f9d15e311
itertools.pyi: Allow omitting repeat argument in Python 3 ( #2659 )
...
Fixes #2561
2018-11-30 15:58:21 -08:00
Guido van Rossum
de50614957
Stop inheriting Sized in collection ABCs ( #2658 )
...
Instead define abstract __len__ in affected classes.
Fixes #2655 without breaking
https://github.com/rominf/ordered-set-stubs/issues/1
2018-11-30 13:10:35 -08:00
Jukka Lehtosalo
eaeb5fcf13
Revert "Move Sized earlier in the bases of Sequence ( #2602 )" ( #2657 )
...
This reverts commit 4dc21f04dd .
Fixes #2655 .
2018-11-30 14:48:55 +00:00
Jukka Lehtosalo
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 Rittau
ece96777a7
Re-export pyexpat instead of using check_consistency ( #2649 )
2018-11-29 07:29:59 -08:00
anentropic
98e63d2d2f
staticmethod and classmethod can wrap any callable ( #2650 )
...
Closes : #2645
2018-11-29 14:36:08 +01:00
Michael R. Crusoe
48183b1d27
Unicode fixes for url2pathname() and pathname2url() ( #2555 )
2018-11-29 14:28:07 +01:00
Florian Bruhin
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