Skip to content

Make getter, setter & deleter decorators to return the Property or Parameter instance instead of returning fget, fset and fdel methods #63

Open
@VigneshVSV

Description

@VigneshVSV

The Property getter, setter & deleter methods need to have a different name than the property itself, otherwise the property instance will be replaced.

This is contradictory to python's own property behaviour where the getter decorator returns the property instead of the getter method and the name must match to the name of the property. However, an explicitly differently named getter/setter/deleter can be passed in the __init__ of python's property. This is how one can have control over the naming styles in python's property.

We should replicate this behaviour. Also the reason of not using python's property is already described in the documentation - python's own property does not allow foreign attributes as its a C implementation.

Rough number of steps:

  • make our getter, setter, deleter return self or Parameter or Property instance
  • in our entire code base, where Properties and Parameters are used with getters/setters/deleters, rename the getter, setter and deleters to use the Parameter's name.
  • make sure tests also follow same convention

Metadata

Metadata

Assignees

Labels

beginnerbeginner level good first issues, usually issues that can worked on without skimming the whole repogood first issueGood for newcomers

Type

Projects

Status

Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions