| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
How is PyGetSet different from PyProperty? |
Sorry, something went wrong.
|
in CPython, PyGetSet corresponds to getset_descriptor while PyProperty corresponds to property. this is data specialized form of property. How about thinking like PyBulitinMethod and PyBoundMethod relationship? Practically, it is only created with native functions with solid getter and setter signature. So it must be related to performance. For compatibility point of view, the properties of None object matters too. Because descriptors get obj argument for __get__ and checking its existance by not-equal-None, properties of None object is nessessarily broken. getset_descriptor doesn't check it but always call getter function. |
Sorry, something went wrong.
|
Maybe it would be good to replace all the property APIs (new_property, PropertyBuilder, etc) with these descriptors, if not in this PR then in another one. It seems like there's not really a benefit to using properties from native code, so in basically every situation you'd prefer getset over property (just not in, like, the builtins.property() decorator) |
Sorry, something went wrong.
|
After grep CPython code, yes, that sounds true. |
Sorry, something went wrong.
|
@coolreader18 It seems this is finally done! will you review it please? |
Sorry, something went wrong.
|
I attached #1736 to here because it is trivial derived work from this PR |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good, I had one note about the getters/setters for SyntaxError but otherwise feel free to merge.
Sorry, something went wrong.
|
Other getters of SyntaxError are actually not a getter by args. they are attributes set by set_attr |
Sorry, something went wrong.
| 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.