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

[Python-Dev] Arbitrary attributes on funcs and methods

[Python-Dev] Arbitrary attributes on funcs and methodsSkip Montanaro skip@mojam.com (Skip Montanaro)
Wed, 12 Apr 2000 15:33:22 -0500 (CDT)
    me> >>> l = [1,2,3]
    me> >>> l.__type__ = "int"

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

Yeah, but there's no reason you wouldn't want to reason about them.  They
are, after all, first-class objects.  If you consider these other attributes
as meta-data, allowing data attributes to hang off lists, tuples, ints or
regex objects makes perfect sense to me.  I believe someone else during this
thread suggested that one use of function attributes might be to record the
function's return type.  My example above is not really any different.
Simpleminded, yes.  Part of the value of l, no.

Skip




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