On Mon, Jan 3, 2011 at 1:40 PM, Georg Brandl <georg@python.org> wrote: ..
I don't think so -- the reader may not be aware of that subclass relationship, and the repr() of struct_time also doesn't make that clear (which is anyway not its job). It certainly doesn't hurt to be a little helpful here.
How far would you go? We cannot list any possible subclass of tuple:
tm = collections.namedtuple('tm', 'a b c d e f g h i') time.asctime(tm(*[0]*9)) 'Mon Jan 1 00:00:00 2000'
I cannot imagine that someone would want to create a struct_time instance to pass to time.asctime or time.strftime and it is rather obvious that these functions should accept what say time.localtime() produces. Given that struct_time repr is currently not eval-friendly, I think the longer a user can get without learning about it, the happier she will be. :-)