Movatterモバイル変換
[0]ホーム
[Python-Dev] Arbitrary attributes on funcs and methods
David AscherDavidA@ActiveState.com
Wed, 12 Apr 2000 15:51:36 -0700
Gordon McMillan:> Jeremy Hylton wrote:> > It prevents confusion and errors> > that might result from unprincipled use of function attributes.>> While I'm sure I will be properly shocked and horrified when> you come up with an example, in my naivety, I can't imagine> what it will look like ;-).I'm w/ Gordon & Barry on this one. I've wanted method and functionattributes in the past and had to rely on building completely new classes w/__call__ methods just to 'fake it'. There's a performance cost to having todo that, but most importantly there's a big increase in code complexity,readability, maintanability, yaddability, etc.I'm surprised that Jeremy sees it as such a problem area -- if I wanted toplay around with static typing, having a version of Python which let mestore method metadata cleanly would make me jump with joy.FWIW, I'm perfectly willing to live in a world where 'unprincipled use ofmethod and function attributes' means that my code can't get optimized, justlike I don't expect my code which modifies __class__ to get optimized (aslong as someone defines what those principles are!).--david
[8]ページ先頭