Commit Graph

21 Commits

Author SHA1 Message Date
edgchen1
1989265e1f Make inspect.unwrap() stop argument optional. (#2583)
Closes #2574
2018-11-03 02:12:49 +01:00
Rebecca Chen
3d8a8ec45d Fix py3 types of inspect.FullArgSpec.var(args|kw) (#2556) 2018-10-25 10:45:59 -07:00
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
Daniel Li
87c296c964 Some inspect.formatargspec args cannot be None (#2212)
The annotations, formatarg, formatvarargs, formatvarkw, formatvalue,
formatreturns, and formatannotations arguments to inspect.formatargspec
have default values, but they cannot be None.
2018-06-11 08:07:47 -07:00
Froger David
ae91695fb7 Inspect (#2178)
* add inspect.{isasyncgenfunction,isasyncgen} (3.6)

* reorder inspect.CO_* as in Python 3.6 doc

* add inspect.CO_{COROUTINE,ITERABLE_COROUTINE} (3.5)

* add inspect.CO_ASYNC_GENERATOR (3.6)

* use variable annotations

* use version checks

* Parameter.empty is a class attribute

* Signature.empty is a class attribute
2018-06-05 09:59:09 -07:00
Mathieu Leduc-Hamel
351d019241 Mark inspect.getmembers as Optional for both Py2 and Py3 (#2172) 2018-05-29 10:43:34 -07:00
Phillip Schanely
86f9472bc9 Correct 2 typing comments in inspect module (#2110) 2018-05-12 01:27:29 -04:00
Jelle Zijlstra
26e573ba1c change default value to ... in inspect.pyi (#1998)
This is in our style guide. This is the last piece of offending code; I just submitted ambv/flake8-pyi#10 to enforce the rule in the linter in the future.
2018-03-28 20:24:39 -07:00
rchen152
8d46ada49d Add undocumented but occasionally used attributes to inspect.pyi. (#1864)
* Add attributes not in docs to 2/inspect.pyi.
* Add attributes not in docs to 3/inspect.pyi.
* Change list to List[Any] in 2/inspect.pyi
2018-02-14 16:20:55 +00: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
4ea798b869 inspect.getmoduleinfo was removed in 3.6 (#1318)
Compare https://docs.python.org/3.5/library/inspect.html#inspect.getmoduleinfo
and https://docs.python.org/3.6/library/inspect.html
2017-05-23 16:52:16 -07:00
Jelle Zijlstra
c1944f944e fix some missing ", ..." in tuples (#1079) 2017-03-22 21:04:39 -07:00
Jelle Zijlstra
349ff59f33 change empty bodies from "pass" to "..."
CONTRIBUTING.md says to prefer ... Not the most impactful change but fixing
these will allow us to lint for it in the future and get a consistent style.
2017-03-16 09:13:08 -07:00
Alvaro Caceres
f90a6d1c0e Inspect: use any instead of object (#585)
* Have inspect.getmembers' return value use Any instead of object
2016-10-06 11:36:17 -07:00
Antoine Catton
5b5135878b Typo: isis -> is (#495)
Fixes inspect.isgeneratorfunction().
2016-08-23 16:24:16 -07:00
Jakub Stasiak
ea37877558 Improve Python 3 inspect stub
This is follow-up to a similar commit improving Python 2.7 inspect stub[1].

Similarly, this commit consists of:

* Splitting and reordering the content into sections corresponding
  to the module's documentation sections
* Implementing missing functions, classes etc.
* Adding TODOs for things that are either difficult to get or I can't
  figure them out right now
* Making the existing code consistent with the newly added things

As suggested in pull request #108 I'm modifying the generic Python 3
stub even though some things changed and were added in various Python
3.x releases - the changes seem to be backwards compatible and the
additions, well, they should not break much except for some false
positives on older Python 3 versions.

Some of the types in this stub were not obvious so I either read the
source code or used my judgment.

[1] 630f718376
2016-03-10 01:28:07 +01:00
Guido van Rossum
740568ed25 Use NamedTuple for inspect.ArgSpec and .FullArgSpec. 2016-01-18 16:51:23 -08:00
Ben Darnell
3a674645a5 Assorted fixes to stubs 2016-01-16 16:52:01 -05:00
Ben Longbons
793f3399a7 Stub for inspect.stack() and related classes 2015-10-12 10:35:04 -07:00
Matthias Kramm
337abed05a add (overwrite with) mypy stubs, if available 2015-09-30 09:59:44 -07:00