Is this considered black magic?

Rainer Deyke root at rainerdeyke.com
Mon Nov 12 13:07:07 EST 2001


"Laura Creighton" <lac at strakt.com> wrote in message
news:mailman.1005580996.11004.python-list at python.org...
> I have a new problem.  I've just lost a major amount of precision in my
> language usage.  What is the collective noun for 'attributes that aren't
> methods (you can't call them)'?

A non-callable attribute is just that, a non-callable attribute.  Note that
this includes things that you might not think of as methods:

class C:
  def __init__(self, something)
    self.something = something
  class nested_class:
    pass

c = C(abs)
assert callable(c.__class__)
assert callable(c.nested_class)
assert callable(c.something)


In general I use the terms "instance attribute" to refer to object
attributes that are carried around by the actual object, "class attribute"
to refer to attributes that an object inherits from its class, and "method"
to refer to objects that are actually of a method type ('instance method' or
'builtin_function_or_method', where an iunstance if the latter is only a
method if it indentifies itself as such in it's repr).


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list