A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-April/003437.html below:

[Python-Dev] Arbitrary attributes on funcs and methods

[Python-Dev] Arbitrary attributes on funcs and methodsDavid Ascher DavidA@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 function
attributes 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 to
do 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 to
play around with static typing, having a version of Python which let me
store method metadata cleanly would make me jump with joy.

FWIW, I'm perfectly willing to live in a world where 'unprincipled use of
method and function attributes' means that my code can't get optimized, just
like I don't expect my code which modifies __class__ to get optimized (as
long as someone defines what those principles are!).

--david





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4