Re: What about an EXPLICIT naming scheme for built-ins?
From: Jason Lai (jmlai_at_uci.edu)
Date: 09/03/04
- Next message: Jp Calderone: "Re: print with no newline"
- Previous message: Grant Edwards: "Re: It's in Python. It just _works_!"
- In reply to: Carlos Ribeiro: "Re: What about an EXPLICIT naming scheme for built-ins?"
- Next in thread: Alex Martelli: "Re: What about an EXPLICIT naming scheme for built-ins?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 03 Sep 2004 08:27:11 -0700
Carlos Ribeiro wrote:
> On Sat, 4 Sep 2004 00:15:41 +1000, Andrew Durdin <adurdin@gmail.com> wrote:
>
>>However, I think it'd be hard to make an iterator implementation of
>>sorted() without either copying the sequence or resorting to O(n^2)
>>performance, which is not good.
>>This may just be an example where inconsistency is a practical necessity.
>
>
> You may be right. At the least, this reasoning could possibly be
> included in the FAQ, as it will probably turn out to be a frequent
> question in the near future. But having sorted() to return a iterator
> still sounds like a logical thing to do, so I'm not sure about it.
>
I had an idea for a moment about having sorted/reversed return the same
type as it was passed -- so reversed(seq) returns a seq,
reversed(iterator) returns an iterator. But it sounds confusing/magical
and maybe out of line with Python philosophy. Although I think the whole
iterator usage seems a little messy right now, so it's worth thinking
about how seq/iterators-related functions should behave.
- Jason Lai
- Next message: Jp Calderone: "Re: print with no newline"
- Previous message: Grant Edwards: "Re: It's in Python. It just _works_!"
- In reply to: Carlos Ribeiro: "Re: What about an EXPLICIT naming scheme for built-ins?"
- Next in thread: Alex Martelli: "Re: What about an EXPLICIT naming scheme for built-ins?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|