On Wed, Aug 15, 2012 at 12:19 PM, Olemis Lang <[email protected]> wrote:
> you can also do this in case you don't want get_something and
> set_something methods in that class (<= which are not as Pythonic as
> uniform attribute access via properties and descriptors in general ;)
>
> {{{
> #!python
>
> class Foo():
>    def __init__(self):
>      self.something = None

I take it from the code that follows that you mean "self._something = None"?

>
>     @property

That "@property" tells Python (or Trac?) something about how the
following definition is used?

>     def something(self, val):
>        # do stuff
>        self._something = val
>
>     @something.setter

Same question as about "@property"

>     def something(self):
>        return self._something # or calculate it or whatever

How is that class used?

                                                                        Chris
-- 
A: Top-posting.
Q: What is the most annoying thing in e-mail?

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to