CLN: Rename __p__→_parent, clean-up gtag, _factory and __rings__#1467
Merged
jorisvandenbossche merged 1 commit intoshapely:mainfrom Aug 14, 2022
Merged
CLN: Rename __p__→_parent, clean-up gtag, _factory and __rings__#1467jorisvandenbossche merged 1 commit intoshapely:mainfrom
__p__→_parent, clean-up gtag, _factory and __rings__#1467jorisvandenbossche merged 1 commit intoshapely:mainfrom
Conversation
Pull Request Test Coverage Report for Build 2816629751
💛 - Coveralls |
Pull Request Test Coverage Report for Build 2842997416
💛 - Coveralls |
Member
Author
|
I'm tempted to also clean-up >>> from shapely.geometry import Point
>>> g = Point(0,1).buffer(1)
>>> g.interiors.gtag()
-7868044578161086364 |
Member
I would personally fine with just removing it in shapely 2.0 (without having first deprecated it, we can list it in the whatsnew under the breaking changes). I would be surprised if many people are using this? |
__p__→_parent, clean-up _factory and __rings____p__→_parent, clean-up gtag, _factory and __rings__
Member
Author
|
Ok, I've update this to remove |
__p__→_parent, clean-up gtag, _factory and __rings____p__→_parent, clean-up gtag, _factory and __rings__
jorisvandenbossche
approved these changes
Aug 14, 2022
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was partially discussed in #983 to rename a few variables. But also clean-up variables that are no longer used with shapely-2.
__p__→_parentto make it "private", and generally avoid non-standard dunder names. Another consideration is to rename it to__parentto enable name mangling for sub classes, see docs Private Variable and Reserved classes of identifiers. Another consideration is with__del__, "Python guarantees that globals whose name begins with a single underscore are deleted from their module before other globals are deleted", implying that a double underscore variable would be deleted last._factory, which was formerly a callable that returned instances of Shapely geometries, i.e.geom_factory__rings__, which was another former structure