Commit Graph

18 Commits

Author SHA1 Message Date
Sebastian Rittau
d2a7889fe0 Drop support for Python 3.5 (#4675)
Python 3.5 EOL was on 2020-09-30.
2020-11-02 16:18:20 +01:00
Shantanu
6ff5b88ca7 typeshed: remove crufty comments (#4699)
Co-authored-by: hauntsaninja <>
2020-10-23 09:40:06 +02:00
Nils K
0ce16647d8 Added additional attributes to re.error (#4463)
https://docs.python.org/3/library/re.html#re.error

These were added in Python 3.5
2020-08-19 11:32:53 -07:00
Sebastian Rittau
5e76f51930 Upgrade to isort 5 (#4323)
This now also reformats imports not at the top of files.
2020-07-16 07:01:57 -07:00
Jelle Zijlstra
5d553c9584 apply black and isort (#4287)
* apply black and isort

* move some type ignores
2020-06-28 13:31:00 -07:00
Shantanu
87791e4e15 re: various fixes (#3746)
* re: mark positional-only args

* re: fix escape arg name

* re: update whitelist
2020-02-21 11:55:11 +01:00
Rune Tynan
359817bde9 In python versions 3.7 and above, re-export Pattern and Match (#3510) 2019-11-29 06:03:45 -08:00
Jelle Zijlstra
d05a9d3d83 Improve enums (#3168)
I realized while working on srittau/type-stub-pep#64 that a
few things we do in existing enum definitions in typeshed are
problematic:

- Using "= ..." doesn't allow type checkers to correctly type the
  result of Enum.MEMBER.value. In fact, mypy at least infers
  .value to be "Ellipsis" if you do this.
- Properties on the enum values themselves, like HTTPStatus.phrase,
  should not be specified directly as attributes, because it makes
  type checkers think that the properties themselves are enum
  members.

I ended up doing a bit more cleanup to the signal module:
- Remove unnecessary ... initializers.
- Remove unnecessary _SIG = Signals alias.
- I don't have Windows to test, but the C code for _signal suggests
  that CTRL_C_EVENT and CTRL_BREAK events are not Signals, but just ints:
  1dbd084f1f/Modules/signalmodule.c (L1575)
2019-08-05 08:08:57 -07:00
Michael Lee
efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
Chen Li
094974c3f5 [re] Add attribute '_pattern_type' to re. (#2877)
This is only available before python 3.7 based on:
https://github.com/python/cpython/blob/3.6/Lib/re.py#L283
https://github.com/python/cpython/blob/3.7/Lib/re.py
2019-03-20 01:20:24 +01:00
shahin
d3a9650fa1 Fix return type of re.match, re.search (#1886) 2018-02-19 09:23:57 -08:00
Pieter-Jan Briers
d7533152f9 (3.6+) Adds re.RegexFlag and use it. (#1592)
* Make 3.6 functions take Union[int, RegexFlag] instead.
2017-09-23 08:58:31 -04:00
Jelle Zijlstra
89f27742ca add re.template (#1330) 2017-05-24 14:07:31 -07:00
Jakub Stasiak
44b367c7fe Add re fullmatch() information (#381) 2016-07-26 07:43:29 -07:00
Scott G. Ainsworth
82b9baed3b Changed all regular expression findall() to return list[Any]. Findall() can return both list[AnyStr] and list[Tuple[AnyStr, AnyStr]]. (#269) 2016-06-05 17:50:12 -07:00
Guido van Rossum
3e37029bfe Almost all re functions take a compiled pattern. (Even re.compile()!) (#203)
* Almost all re functions take a compiled pattern. (Even re.compile()!)

Fixes #188

Note: I'm using AnyStr so that the type of string used for pattern and
for the rest of the arguments must match.  This is not 100% correct,
since Python 2 sometimes allows mixed types.  But sometimes it
doesn't, depending on the values (e.g. non-ASCII bytes), and Python 3
always insists on matching, so I think this is actually a good idea.

* Same treatment for stdlib/3/re.pyi.
2016-05-16 11:25:59 -07:00
Matthias Kramm
94c9ce8fd0 Consistently use '= ...' for optional parameters. 2015-11-09 13:55:02 -08:00
Matthias Kramm
337abed05a add (overwrite with) mypy stubs, if available 2015-09-30 09:59:44 -07:00