[Python-ideas] PEP proposal: unifying function/method classes

Jeroen Demeyer J.Demeyer at UGent.be
Fri Mar 23 02:25:33 EDT 2018


On 2018-03-23 00:36, Antoine Pitrou wrote:
> It does make sense, since the proposal sounds ambitious (and perhaps
> impossible without breaking compatibility).

Well, *some* breakage of backwards compatibility will be unavoidable.


My plan (just a plan for now!) is to preserve backwards compatibility in 
the following ways:

* Existing Python attributes of functions/methods should continue to 
exist and behave the same

* The inspect module should give the same results as now (by changing 
the implementation of some of the functions in inspect to match the new 
classes)

* Everything from the documented Python/C API.


This means that I might break compatibility in the following ways:

* Changing the classes of functions/methods (this is the whole point of 
this PEP). So anything involving isinstance() checks might break.

* The undocumented parts of the Python/C API, in particular the C structure.


More information about the Python-ideas mailing list