danielpronych / python-twitter

Automatically exported from code.google.com/p/python-twitter
Apache License 2.0
0 stars 0 forks source link

created_at as a datetime instance? #91

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When using the api, I convert the created_at property of the various
statuses into a datetime.datetime object as I find it more useful (easier
to reformat0. I'm happy to submit a patch for that, if you think that
should be the default behaviour :)

Original issue reported on code.google.com by darren.w...@gmail.com on 29 Aug 2009 at 4:26

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hmm, I did get a comment from billzy saying there would be interest, though I 
dont
see it here?

Anyway, attached is a first draft with modified tests (diff is against trunk). 
If you
want to consider some sort of backwards compatibility, then a couple of ways 
off the
top of my head: define another property (created_at_string?), put an option in 
the
constructor to produce the old behaviour (defaulting to whichever is more
appropriate), or getting a bit too clever(?) - subclass datetime and override 
__str__
to return the original formatting?

Original comment by darren.w...@gmail.com on 2 Sep 2009 at 6:17

Attachments: