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/2001-October/018241.html below:

[Python-Dev] class dict of subtyped types

[Python-Dev] class dict of subtyped types [Python-Dev] class dict of subtyped typesGuido van Rossum guido@python.org
Mon, 29 Oct 2001 15:12:19 -0500
> > The dict-proxy type is intended to provide a read-only proxy, so the
> > dict-proxy is consciously lacking the update, clear, popitem and
> > setdefault methods.  It also seems to be missing the comparison
> > operations; that's an oversight.
> > 
> But adding attributes to the INT class above after creation
> is allowed, I hope? At least it currently works.

Yes, but you have to use the attribute notation:

    INT.foo = ...

this is trapped so that certain magic happens automatically when you
set attributes that override operators, e.g.

    INT.__add__ = lambda ...

--Guido van Rossum (home page: http://www.python.org/~guido/)



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