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/2005-November/057851.html below:

[Python-Dev] apparent ruminations on mutable immutables (was: PEP 351, the freeze protocol)

[Python-Dev] apparent ruminations on mutable immutables (was: PEP 351, the freeze protocol)Josiah Carlson jcarlson at uci.edu
Tue Nov 1 22:03:56 CET 2005
> That's fine. I wish that you read my answer, think about it a little,
> and just tell me in a yes or a no if you still consider it dead. I
> think that I have answered all your questions, and I hope that at
> least others would be convinced by them, and that at the end my
> suggestion would be accepted.

I still consider it dead.
    "If the implementation is hard to explain, it's a bad idea."

Also, not all user-defined classes have a __dict__, and not all
user-defined classes can have arbitrary attributes added to them.

c>>> class foo(object):
...     __slots__ = ['lst']
...     def __init__(self):
...         self.lst = []
...
>>> a = foo()
>>> a.bar = 1
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'foo' object has no attribute 'bar'
>>> 

 - Josiah

More information about the Python-Dev mailing list

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