Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82438 > unrolled thread

Re: is_<whatever_you_are_testing_for> as method or property?

Started byChris Angelico <rosuav@gmail.com>
First post2014-12-12 22:26 +1100
Last post2014-12-12 22:26 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: is_<whatever_you_are_testing_for> as method or property? Chris Angelico <rosuav@gmail.com> - 2014-12-12 22:26 +1100

#82438 — Re: is_<whatever_you_are_testing_for> as method or property?

FromChris Angelico <rosuav@gmail.com>
Date2014-12-12 22:26 +1100
SubjectRe: is_<whatever_you_are_testing_for> as method or property?
Message-ID<mailman.16904.1418383605.18130.python-list@python.org>
On Fri, Dec 12, 2014 at 10:21 PM, Mateusz Loskot <mateusz@loskot.net> wrote:
> I've got several cases which are not obvious to me.
> For instance, class Foo has a boolean attribute, read-write,
> which I see a couple of realisations for possible:
>

0) Attribute only.

class Foo:
    pass

Foo().default = True

Unless you need something more than this, go with this style. Much simpler.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web