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/2003-May/035587.html below:

[Python-Dev] Re: __slots__ and default values

[Python-Dev] Re: __slots__ and default values [Python-Dev] Re: __slots__ and default valuesThomas Heller theller@python.net
13 May 2003 17:45:34 +0200
Michael Chermside <mcherm@mcherm.com> writes:

> Combine this with the fact that newbies from staticly typed 
> languages tend to think of __slots__ as "practically mandatory" 
> (because it prevents the use of instance variables not pre-declared,
> which they erroniously think is a good thing) rather than the 
> special purpose performance hack that it REALLY is, and you have
> a recipe for trouble.

Unrelated to *this* topic, but Andrew's "What's new in Python 2.2" still
presents __slots__ as a way to constrain the instance variables:

  A new-style class can define a class attribute named __slots__ to
  constrain the list of legal attribute names.

http://www.python.org/doc/current/whatsnew/sect-rellinks.html#SECTION000340000000000000000

This should probably be fixed.

Thomas




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