4 ms·
Given the context of this thread (comparison of ruby and python), it should be noted that python also has this. You can decorate a method with `@property` and c
by ByteJockey 4y ago
Given the context of this thread (comparison of ruby and python), it should be noted that python also has this. You can decorate a method with `@property` and call the method without parentheses.
It's really nice because it means you don't have to pre-wrap all of your properties with accessor methods. They can just be properties, and if something changes, you swap the property out with a decorated method and you don't need to change any code.