| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@erlend-aasland @AlexWaygood I'm sharing my consideration for the design of this PR.
I will update the devguide about the restriction of docstring for property. |
Sorry, something went wrong.
|
@erlend-aasland @AlexWaygood Updated :) PTAL |
Sorry, something went wrong.
|
Ideally, I would prefer this:
What do you think, @AlexWaygood? |
Sorry, something went wrong.
Ideally, yes, but I think that this very difficult requirement in current status if you want to support all of the situations in a AC; since the AC does not care about another method state (aka stateless), it's very difficult to interact with another method or propety state. |
Sorry, something went wrong.
|
If we want to make AC care about other method states, we should reconstruct AC from scratch. |
Sorry, something went wrong.
|
Note: The reason I used the macro declaration of generated c codes was that it was very easy to care about other property declaration statuses without touching overall AC architecture. And the generated C code obviously not affected to performance issue at all :) |
Sorry, something went wrong.
|
Workaround for @setteronly with docstring: |
Sorry, something went wrong.
|
This generated code is verbose, but I read AC code, and I know that it's tricky to add new features in a safe way. PyDoc_STRVAR(_io__TextIOBase_encoding__doc__,
"Encoding of the text stream.\n"
"\n"
"Subclasses should override.");
#define _io__TextIOBase_encoding_HAS_DOCSTR
#if defined(_io__TextIOBase_encoding_HAS_DOCSTR)
# define _io__TextIOBase_encoding_DOCSTR _io__TextIOBase_encoding__doc__
#else
# define _io__TextIOBase_encoding_DOCSTR NULL
#endifI would prefer to not hold this nice enhancement until AC is refactored in a way which avoids such verbose code. Since the code is is generated, I don't care too much about the details, as soon as the C code, after the preprocessor is passed, remains efficient :-) |
Sorry, something went wrong.
|
I'll defer to you three on this one; I agree that @erlend-aasland's idea sounds nicer in principle, but I also don't mind there being slightly ugly generated C code for now, as long as it results in the same behaviour for Python users :) |
Sorry, something went wrong.
|
If there is a need to get this in very quick, I'm ok with rushing it. A lot of the setter/getter code is special cased, mostly because clinic was designed for PyMethodDef, not PyGetSetDef :) If we don't need to rush this, I would prefer if we could try to fit it more nicely into clinic.py. Is this PR blocking other changes?
Well, clinic is already very flexible, so we might not need to refactor it at all, in order to make it work more smoothly. |
Sorry, something went wrong.
|
@erlend-aasland @AlexWaygood @vstinner
Okay, negotiation time :)
Here is a note that I considered cases for this issue that you should consider if you want to suggest other designs.
|
Sorry, something went wrong.
|
As I already wrote, I'm fine with proceeding with this implementation as a temporary workaround. IMO, I think we (myself included) should have put more time into the design of the PyGetSetDef feature before starting to land the recent clinic PRs. If Alex and Victor are ok with this PR, I won't block it. But please create a follow-up issue for refactoring (and possibly redesigning) the PyGetSetDef feature of Argument Clinic, so we don't forget about that :) |
Sorry, something went wrong.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
So far, I avoided "large refactoring" of clinic.py just because of the number of lines. For me, the file is so big that it's a blocker issue for me. I created gh-113299 to split this file into sub-files. |
Sorry, something went wrong.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
There was a problem hiding this comment.
Thanks; please wait for Alex's thumbs up before landing.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks @corona10 <3
Sorry, something went wrong.
--------- Co-authored-by: Erlend E. Aasland <erlend@python.org>
--------- Co-authored-by: Erlend E. Aasland <erlend@python.org>
--------- Co-authored-by: Erlend E. Aasland <erlend@python.org>
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.