On 13 December 2014 at 12:24, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Mateusz Loskot wrote:
On 12 December 2014 at 12:26, Chris Angelico ros...@gmail.com wrote:
On Fri, Dec 12, 2014 at 10:21 PM, Mateusz Loskot mate...@loskot.net
wrote:
I've got several cases which are not
Mateusz Loskot wrote:
On 12 December 2014 at 12:26, Chris Angelico ros...@gmail.com wrote:
On Fri, Dec 12, 2014 at 10:21 PM, Mateusz Loskot mate...@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
On 11 December 2014 at 19:20, Chris Angelico ros...@gmail.com wrote:
On Fri, Dec 12, 2014 at 4:34 AM, Mateusz Loskot mate...@loskot.net wrote:
If a class member function simply tests something and
returns a b::oolean call it
def is_whatever_you_are_testing_for():
pass
like 'is_even'.
On Fri, Dec 12, 2014 at 10:21 PM, Mateusz Loskot mate...@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
On 12 December 2014 at 12:26, Chris Angelico ros...@gmail.com wrote:
On Fri, Dec 12, 2014 at 10:21 PM, Mateusz Loskot mate...@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
On Sat, Dec 13, 2014 at 8:03 AM, Mateusz Loskot mate...@loskot.net wrote:
On 12 December 2014 at 12:26, Chris Angelico ros...@gmail.com wrote:
On Fri, Dec 12, 2014 at 10:21 PM, Mateusz Loskot mate...@loskot.net wrote:
I've got several cases which are not obvious to me.
For instance, class Foo
On 12 December 2014 at 22:14, Chris Angelico ros...@gmail.com wrote:
On Sat, Dec 13, 2014 at 8:03 AM, Mateusz Loskot mate...@loskot.net wrote:
On 12 December 2014 at 12:26, Chris Angelico ros...@gmail.com wrote:
On Fri, Dec 12, 2014 at 10:21 PM, Mateusz Loskot mate...@loskot.net wrote:
I've
Hi,
I have been looking at various places to answer this dilemma:
If a class member function simply tests something and
returns a b::oolean call it
def is_whatever_you_are_testing_for():
pass
like 'is_even'.
Should I define it as a classic method
def is_even(self):
pass
or as a
On Fri, Dec 12, 2014 at 4:34 AM, Mateusz Loskot mate...@loskot.net wrote:
If a class member function simply tests something and
returns a b::oolean call it
def is_whatever_you_are_testing_for():
pass
like 'is_even'.
Should I define it as a classic method
def is_even(self):
pass
On 12/11/2014 09:34 AM, Mateusz Loskot wrote:
def is_whatever_you_are_testing_for():
pass
like 'is_even'.
Should I define it as a classic method
def is_even(self):
pass
or as a property
@property
def is_even(self):
pass
So, a classic method or a property, which
Chris Angelico ros...@gmail.com writes:
A property should be used if what you're creating is virtually an
attribute.
Methods are attributes. Are you distinguishing here between “callable
attribute” versus “non-callable attribute”?
--
\ “Repetition leads to boredom, boredom to
On Thu, Dec 11, 2014 at 1:33 PM, Ben Finney ben+pyt...@benfinney.id.au wrote:
Chris Angelico ros...@gmail.com writes:
A property should be used if what you're creating is virtually an
attribute.
Methods are attributes. Are you distinguishing here between “callable
attribute” versus
On Fri, Dec 12, 2014 at 8:33 AM, Ben Finney ben+pyt...@benfinney.id.au wrote:
Chris Angelico ros...@gmail.com writes:
A property should be used if what you're creating is virtually an
attribute.
Methods are attributes. Are you distinguishing here between “callable
attribute” versus
13 matches
Mail list logo