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

[Python-Dev] Re: lists v. tuples

[Python-Dev] Re: lists v. tuplesJust van Rossum just@letterror.com
Fri, 14 Mar 2003 17:06:14 +0100
Christian Tismer wrote:

> And the key assumption for sorting things is that
> the things are sortable, which means there
> exists and order on the basic set.
> Which again suggests that list elements usually
> have something in common.

To me it suggests that some lists are sortable and others are not...

There's one aspect about this discussion that I haven't seen mentioned
yet: syntax. I think the suggested usages of lists vs. tuples has more
to do with list vs. tuple _syntax_, and less with mutability. From this
perspective it is natural that tuples support a different set of methods
than lists. However, mutable vs. immutable has it's uses also, and from
_that_ perspective it is far less understandable that tuples lack
certain methods.

FWIW, I quite like the way how the core classes in Cocoa/NextStep are
designed. For each container-ish object there's a mutable an immutable
variant, where the mutable variant is usually a subclass of the
immutable one. Examples:
  NSString -> NSMutableString
  NSData -> NSMutableData
  NSArray -> NSMutableArray
  NSDictionary -> NSMutableDictionary

(But then again, Objective-C doesn't have syntax support for lists _or_
tuples...)

Just



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