Re: Python 3.0 - is this true?
- From: Arnaud Delobelle <arnodel@xxxxxxxxxxxxxx>
- Date: Sat, 08 Nov 2008 19:02:28 +0000
walterbyrd <walterbyrd@xxxxxxxxx> writes:
I have read that in Python 3.0, the following will raise an exception:
[2, 1, 'A'].sort()
Will that raise an exception?
Yes. In fact, plenty of objects of different types aren't comparable
anymore.
And, if so, why are they doing this?
How is it helpful to be able to sort things which have no natural order?
How is this helpful?
It goes well with duck typing. It lets you know when you things happen
that you don't mean to happen.
Is this new "enhancement" Pythonic?
By definition!
--
Arnaud
.
- Follow-Ups:
- Re: Python 3.0 - is this true?
- From: walterbyrd
- Re: Python 3.0 - is this true?
- From: Steven D'Aprano
- Re: Python 3.0 - is this true?
- References:
- Python 3.0 - is this true?
- From: walterbyrd
- Python 3.0 - is this true?
- Prev by Date: Re: Python 3.0 - is this true?
- Next by Date: Re: using datetime containers
- Previous by thread: Re: Python 3.0 - is this true?
- Next by thread: Re: Python 3.0 - is this true?
- Index(es):
Relevant Pages
|