No, not always. You can use yuples as dictionary key as keys are immutable
and you can't use it as list.
--
https://mail.python.org/mailman/listinfo/python-list
On 2014-02-23, Sam lightai...@gmail.com wrote:
My understanding of Python tuples is that they are like immutable
lists. If this is the cause, why can't we replace tuples with lists
all the time (just don't reassign the lists)? Correct me if I am
wrong.
In addition to the things related to
In article 64af70e3-6876-4fbf-8386-330d2f487...@googlegroups.com,
Sam lightai...@gmail.com wrote:
My understanding of Python tuples is that they are like immutable lists. If
this is the cause, why can't we replace tuples with lists all the time (just
don't reassign the lists)? Correct me if
In article led9s7$req$1...@reader1.panix.com,
Grant Edwards invalid@invalid.invalid wrote:
In constrast, tuples are often used as fixed-length heterogenous
containers (more like a struct in C except the fields are named 0, 1,
2, 3, etc.). In a particular context, the Nth element of a tuple
On 23/02/2014 17:48, Roy Smith wrote:
In article led9s7$req$1...@reader1.panix.com,
Grant Edwards invalid@invalid.invalid wrote:
In constrast, tuples are often used as fixed-length heterogenous
containers (more like a struct in C except the fields are named 0, 1,
2, 3, etc.). In a
On 3/1/2014 4:20 PM, Mark Lawrence wrote:
On 23/02/2014 17:48, Roy Smith wrote:
It also appears that tuples are more memory efficient. I just ran some
quick tests on my OSX box. Creating a list of 10 million [1, 2, 3, 4,
5] lists gave me a 1445 MB process. The name number of (1, 2, 3, 4,
On Sunday, February 23, 2014 12:06:13 PM UTC+8, Sam wrote:
My understanding of Python tuples is that they are like immutable lists. If
this is the cause, why can't we replace tuples with lists all the time (just
don't reassign the lists)? Correct me if I am wrong.
==
OK, lets be serious
My understanding of Python tuples is that they are like immutable lists. If
this is the cause, why can't we replace tuples with lists all the time (just
don't reassign the lists)? Correct me if I am wrong.
--
https://mail.python.org/mailman/listinfo/python-list
Sam lightai...@gmail.com writes:
My understanding of Python tuples is that they are like immutable
lists. If this is the cause, why can't we replace tuples with lists
all the time (just don't reassign the lists)?
You can do that a lot of the time but not always. For example, you can
use a
On Sun, Feb 23, 2014 at 3:06 PM, Sam lightai...@gmail.com wrote:
My understanding of Python tuples is that they are like immutable lists. If
this is the cause, why can't we replace tuples with lists all the time (just
don't reassign the lists)? Correct me if I am wrong.
One reason is
Sam lightai...@gmail.com writes:
My understanding of Python tuples is that they are like immutable
lists.
That's a common expression, but I think it's not a helpful way to think
of them.
Rather, the different sequence types have different semantic purposes:
* For representing a sequence
11 matches
Mail list logo