| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
|
|
|
| |
the rest in Signature.__str__. #20356
|
|
|
|
|
| |
Some classes defined in C may not have the '__module__' attribute, so
we now handle this case to avoid having unexepected AttributeError.
|
|
|
|
|
|
| |
PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type)
have been modified to provide introspection information for builtins.
Also: many additional Lib, test suite, and Argument Clinic fixes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* You may now specify an expression as the default value for a
parameter! Example: "sys.maxsize - 1". This support is
intentionally quite limited; you may only use values that
can be represented as static C values.
* Removed "doc_default", simplified support for "c_default"
and "py_default". (I'm not sure we still even need
"py_default", but I'm leaving it in for now in case a
use presents itself.)
* Parameter lines support a trailing '\\' as a line
continuation character, allowing you to break up long lines.
* The argument parsing code generated when supporting optional
groups now uses PyTuple_GET_SIZE instead of PyTuple_GetSize,
leading to a 850% speedup in parsing. (Just kidding, this
is an unmeasurable difference.)
* A bugfix for the recent regression where the generated
prototype from pydoc for builtins would be littered with
unreadable "=<object ...>"" default values for parameters
that had no default value.
* Converted some asserts into proper failure messages.
* Many doc improvements and fixes.
|
|
|
|
|
| |
default values. inspect.Signature correspondingly supports them in
__text_signature__ fields for builtins.
|
|\ |
|
| | |
|
| |
| |
| |
| | |
for some builtins.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
located in the metaclass.
Okay, hopefully the very last patch for this issue. :/
I realized when playing with Enum that the metaclass attributes weren't always displayed properly.
New patch properly locates DynamicClassAttributes, virtual class attributes (returned by __getattr__ and friends), and metaclass class attributes (if they are also in the metaclass __dir__ method).
Also had to change one line in pydoc to get this to work.
Added tests in test_inspect and test_pydoc to cover these situations.
|
| |
| |
| |
| | |
proxy is.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Order of search is now:
1. Try getattr
2. If that throws an exception, check __dict__ directly
3. If still not found, walk the mro looking for the eldest class that has
the attribute (e.g. things returned by __getattr__)
4. If none of that works (e.g. due to a buggy __dir__, __getattr__, etc.
method or missing __slot__ attribute), ignore the attribute entirely.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
inspect.getmembers and inspect.classify_class_attrs now search the metaclass
mro for types.DynamicClassAttributes (what use to be called
enum._RouteClassAttributeToGetattr); in part this means that these two
functions no longer rely solely on dir().
Besides now returning more accurate information, these improvements also
allow a more helpful help() on Enum classes.
|
| | |
|
| |
| |
| |
| | |
(last) to find where an attr was defined.
|
|\ \
| |/
| |
| | |
when input list contains duplicates.
|
| |
| |
| |
| | |
when input list contains duplicates.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| | |
Initial patch by Daniel Urban and Aaron Iles
|
| | |
|
| |
| |
| |
| |
| |
| | |
To make sure there is no issue with code that is both Python 2 and 3
compatible, there are no plans to remove the module any sooner than
Python 4 (unless the community moves to Python 3 solidly before then).
|
| |
| |
| |
| | |
ModuleNotFoundError.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
attributes to None.
The long-term goal is for people to be able to rely on these
attributes existing and checking for None to see if they have been
set. Since import itself sets these attributes when a loader does not
the only instances when the attributes are None are from someone
overloading __import__() and not using a loader or someone creating a
module from scratch.
This patch also unifies module initialization. Before you could have
different attributes with default values depending on how the module
object was created. Now the only way to not get the same default set
of attributes is to circumvent initialization by calling
ModuleType.__new__() directly.
|
|\ \
| |/ |
|
| |
| |
| |
| | |
inspect.findsource(). Initial patch by Tyler Doyle.
|
|\ \
| |/
| |
| | |
is named self.
|
| |
| |
| |
| | |
is named ``self``.
|
|/ |
|
| |
|
|
|
|
| |
importlib.machinery.all_suffixes() API rather than the deprecated inspect.getmoduleinfo()
|
|
|
|
| |
of generator state updates
|
| |
|
|
|
|
| |
Patch by Yury Selivanov.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
importlib.machinery that provide the suffix details for import.
The attributes were not put on imp so as to compartmentalize
everything importlib needs for setting up imports in
importlib.machinery.
This also led to an indirect deprecation of inspect.getmoduleinfo() as
it directly returned imp.get_suffix's returned tuple which no longer
makes sense.
|
|\ |
|
| |
| |
| |
| |
| |
| | |
trigger code execution with inspect.getattr_static.
Closes issue 11829.
|
|\ \
| |/
| |
| | |
Also fixes issue #13581: `help(type)` wouldn't display anything.
|
| |
| |
| |
| | |
Also fixes issue #13581: `help(type)` wouldn't display anything.
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Closes issue 11813.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| | |
This fixes a regression compared to 2.x, where sys.modules.items()
returns a copy, as indicated by a comment in the source. Diagnosis and
patch by Erik Tollerud.
|
| |
| |
| |
| | |
A patch from Vincent Legoll.
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| | |
This allows findsource() to work in doctests.
A patch from Dirkjan Ochtman.
|
|/ |
|