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

[Python-Dev] Arbitrary attributes on funcs and methods

[Python-Dev] Arbitrary attributes on funcs and methodsGreg Stein gstein@lyra.org
Wed, 12 Apr 2000 12:29:04 -0700 (PDT)
On Wed, 12 Apr 2000, Skip Montanaro wrote:
>...
>     BAW> Floats don't currently have attributes.
> 
> True enough, but why can't they?  I see no reason that your writable
> function attributes proposal requires that functions already have
> attributes.  Modifying my example, how about:
> 
>     >>> l = [1,2,3]
>     >>> l.__type__ = "int"
> 
> Like functions, lists do have (readonly) attributes.  Why not allow them to
> have writable attributes as well?

Lists, floats, etc are *data*. There is plenty of opportunity for creating
data structures that contain whatever you want, organized in any fashion.

Functions are (typically) not data. Applying these attributes is a way to
define program semantics, not record data.

There are two entirely separate worlds here. Adding attributes makes great
sense, as a way to enhance the definition of your program's semantics and
operation.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/




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