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


Groups > comp.lang.python > #76184

Re: odd difference calling function from class or instance variable

From GregS <not@my.real.address.com>
Newsgroups comp.lang.python
Message-ID <2014081311203037705-not@myrealaddresscom> (permalink)
References <201408131006549222-not@myrealaddresscom>
Subject Re: odd difference calling function from class or instance variable
Organization virginmedia.com
Date 2014-08-13 11:20 +0100

Show all headers | View raw


Thanks to both of you for your incredibly prompt replies.  My homework 
for tonight is to digest the descriptor protocol...

Peter, thanks for suggesting using staticmethod() to get the behaviour 
I was expecting.  I've only used staticmethod as a decorator before now.

Chris, I agree that it's not every day you assign functions to class 
attributes, but it does have its uses (I won't bore you with mine).  
Now that I know how it treads on the toes of Python's method magic, I 
can decide whether it's the best approach or not.

Thanks again,

Greg


Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

odd difference calling function from class or instance variable GregS <not@my.real.address.com> - 2014-08-13 10:06 +0100
  Re: odd difference calling function from class or instance variable Peter Otten <__peter__@web.de> - 2014-08-13 11:40 +0200
  Re: odd difference calling function from class or instance variable Chris Angelico <rosuav@gmail.com> - 2014-08-13 19:45 +1000
  Re: odd difference calling function from class or instance variable GregS <not@my.real.address.com> - 2014-08-13 11:20 +0100
    Re: odd difference calling function from class or instance variable Chris Angelico <rosuav@gmail.com> - 2014-08-13 20:29 +1000

csiph-web