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

Adaptation and typecasting (was Re: [Python-Dev] replacing 'global')

Adaptation and typecasting (was Re: [Python-Dev] replacing 'global')Greg Ewing greg at cosc.canterbury.ac.nz
Tue Oct 28 21:56:53 EST 2003
"Phillip J. Eby" <pje at telecommunity.com>:

> Given all this, I think I'm okay with saying that adapting from a mutable 
> object to an immutable interface (e.g list->tuple) is an improper use of 
> adaptation.

Expecting such an adaptation to somehow make the underlying
list unchangeable by any means would be unreasonable, I
think. I can't see any way of enforcing that other than by
making a copy, which goes agains the spirit of adaptation.

There still might be uses for it, though, without any
unchangeability guarantee, such as passing it to something
that requires a tuple and not just a sequence, but not
wanting the overhead of making a copy.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+

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