[Python-Dev] PEP 579 and PEP 580: refactoring C functions and methods (original) (raw)

Stefan Behnel stefan_ml at behnel.de
Sat Jul 7 04:45:34 EDT 2018


INADA Naoki schrieb am 07.07.2018 um 10:08:

Thank you. Do you plan to make it default when PEP 580 is accepted and implemented?

It will become the default at some point, I'm sure. Note that we will still have to support older Python versions, though, currently 2.6+, which would not have the improvements available. Some things might be backportable for us, at least to older Py3.x releases, but we'll see.

Personally speaking, I used Cython for quick & easy alternative way to writing extension types. I don't need compatibility with pure Python functions. I prefer minimum and lightweight. So I will disable it explicitly or stop using Cython.

I'll try to keep the directive available as a compatibility switch for you. ;)

But if you believe PEP 580 makes many Cython users happy, I believe you.

It's more of a transitive thing, for the users of your code. If the functions and methods in the code that I write behave like Python functions, then people who use my code will not run into surprises and quirks when trying to do their stuff with them and things will generally "just work", e.g. inspecting the functions when debugging or using them interactively, looking up their signature, default arguments and annotations, generating documentation from them, pickling, assigning them as methods ... basically anything that people implicitly expect to be able to do with Python functions (or even callables in general) and that doesn't (not well or not at all) work with PyCFunction.

Stefan



More information about the Python-Dev mailing list