On 4/27/2012 11:40 PM, Guido van Rossum wrote:
> On Fri, Apr 27, 2012 at 5:50 PM, Steven D'Aprano <st...@pearwood.info> wrote:
>> 2) get_clock_info returns a dict. Why not a namedtuple?
> 
> Future flexibility. And there's no need for it to be a *tuple*.

I haven't been paying attention to this discussion, so this isn't a
comment on any time functions specifically.

But we generally use a namedtuple (or structseq) for things like
get_clock_info. For example, for sys.float_info there's no need for it
to be a tuple, and it can be extended in the future, yet it's a structseq.

Same for sys.flags, although it's its own type, not a structseq. It is
also indexable, and we've added fields to it (hash_randomization was
added in 2.7.3).

So I think a structseq would work for get_clock_info as well. It's
unfortunate we don't have a similar type which isn't a tuple, but the
types we do have work well enough in practice.

Eric.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to