- missing DECREF in PyModule_FromDefAndSpec2
- missing DECREF in PyType_FromSpecAndBases2
- missing DECREF in _testmultiphase module
Patch by Petr Viktorin
Known limitations of the current implementation:
- documentation changes are incomplete
- there's a reference leak I haven't tracked down yet
The leak is most visible by running:
./python -m test -R3:3 test_importlib
However, you can also see it by running:
./python -X showrefcount
Importing the array or _testmultiphase modules, and
then deleting them from both sys.modules and the local
namespace shows significant increases in the total
number of active references each cycle. By contrast,
with _testcapi (which continues to use single-phase
initialisation) the global refcounts stabilise after
a couple of cycles.
Also, deprecate formatargspec, formatargvalues, and getargvalues
functions. Since we are deprecating 'getfullargspec' function in
3.5 (documentation only, no DeprecationWarning), it makes sense
to also deprecate functions designed to be directly used with it.
In 3.6 we will remove 'getargsspec' function (was deprecated since
Python 3.0), and start raising DeprecationWarnings in other
'getarg*' family of functions. We can remove them in 3.7 or later.
Also, it is worth noting, that Signature API does not provide 100%
of functionality that deprecated APIs have. It is important to do
a soft deprecation of outdated APIs in 3.5 to gather users feedback,
and improve Signature object.
There area bunch of TODOs here, but the biggest (not mentioned in the
file) is that I'm going to take out __instancecheck__ and
__subclasscheck__. However my personal schedule is such that I
probably won't have time for these before Larry tags beta 1. But I
will try -- this commit is mostly to make sure that typing.py doesn't
completely miss the train.
PS. I'm tracking issues at https://github.com/ambv/typehinting/issues.