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/003378.html below:

[Python-Dev] Arbitrary attributes on funcs and methods

[Python-Dev] Arbitrary attributes on funcs and methods [Python-Dev] Arbitrary attributes on funcs and methodsJeremy Hylton jeremy@cnri.reston.va.us
Wed, 12 Apr 2000 12:37:20 -0400 (EDT)
>>>>> "BAW" == Barry A Warsaw <bwarsaw@cnri.reston.va.us> writes:

  BAW> Functions and methods are first class objects, and they already
  BAW> have attributes, some of which are writable.  Why should
  BAW> __doc__ be special?  Just because it was the first such
  BAW> attribute to have syntactic support for easily defining?  

I don't have a principled argument about why doc strings should be
special, but I think that they should be.  I think it's weird that you
can change __doc__ at runtime; I would prefer that it be constant.

  BAW> Think about my proposal this way: it actually removes a
  BAW> restriction. 

I think this is really the crux of the matter!  The proposal removes
a useful restriction.

The alternatives /F suggested seem clearer to me that sticking new
attributes on functions and methods.  Three things I like about the
approach: It affords an opportunity to be very clear about how the
attributes are intended to be used.  I suspect it would be easier to
describe with a static type system.  It prevents confusion and errors
that might result from unprincipled use of function attributes.

Jeremy





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