Skip to content

Modernize property definitions in SplitText#604

Merged
foarsitter merged 1 commit intojazzband:masterfrom
ProtixIT:property-decorators
Apr 3, 2024
Merged

Modernize property definitions in SplitText#604
foarsitter merged 1 commit intojazzband:masterfrom
ProtixIT:property-decorators

Conversation

@mthuurne
Copy link
Contributor

This code was using old property syntax instead of @property decorators.

I also removed the comments, as they don't express anything that isn't already clear from the code itself.

@codecov
Copy link

codecov bot commented Mar 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.57%. Comparing base (994d6c1) to head (d1325d1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #604   +/-   ##
=======================================
  Coverage   98.57%   98.57%           
=======================================
  Files           6        6           
  Lines         773      773           
=======================================
  Hits          762      762           
  Misses         11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mthuurne mthuurne mentioned this pull request Mar 26, 2024
@foarsitter
Copy link
Contributor

To be fully backwards compatible I'm against removing methods (even if they are private) for the 4.5.0 release. Do we need to mention them in the change log?

@mthuurne
Copy link
Contributor Author

To be fully backwards compatible I'm against removing methods (even if they are private) for the 4.5.0 release. Do we need to mention them in the change log?

These methods only exist to implement the property and were introduced at the same time as the property, in commit 8515734. There was never a reason to call the private method over using the public property.

If you're thinking of subclasses that might override the method, that doesn't actually work: the property definition captures the method from the class scope. It doesn't do a lookup on self, so any overriding method will not be used by the property.

@foarsitter foarsitter merged commit 53941ec into jazzband:master Apr 3, 2024
@mthuurne mthuurne deleted the property-decorators branch April 4, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants