This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author abarry
Recipients abarry, ethan.furman
Date 2015-08-20.01:41:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1440034919.77.0.149653408635.issue24897@psf.upfronthosting.co.za>
In-reply-to
Content
The only significant difference is that it lets the instance overwrite the attribute (it doesn't have __set__ or __delete__). For example (using fractions.Fraction to demonstrate), the following:

    def __new__(cls, numerator=0, denominator=None, _normalize=True):
        # ...
        self._numerator = numerator
        self._denominator = denominator

    @property
    def numerator(a):
        return a._numerator

    @property
    def denominator(a):
        return a._denominator

would become:

    def __new__(cls, numerator=0, denominator=None, _normalize=True):
        # ...
        self.numerator = numerator
        self.denominator = denominator

    @attribute
    def numerator(a):
        pass

    @attribute
    def denominator(a):
        pass

This is more of an aesthetic enhancement rather than a functional one.
History
Date User Action Args
2015-08-20 01:41:59abarrysetrecipients: + abarry, ethan.furman
2015-08-20 01:41:59abarrysetmessageid: <1440034919.77.0.149653408635.issue24897@psf.upfronthosting.co.za>
2015-08-20 01:41:59abarrylinkissue24897 messages
2015-08-20 01:41:59abarrycreate