[Checkins] SVN: DateTime/trunk/src/DateTime/DateTime.py Explain why we store a float, instead of directly taking the _micros long -> 10 bytes less in the common case :)
Hanno Schlichting
hannosch at hannosch.eu
Sun May 8 10:12:00 EDT 2011
Log message for revision 121595:
Explain why we store a float, instead of directly taking the _micros long -> 10 bytes less in the common case :)
Changed:
U DateTime/trunk/src/DateTime/DateTime.py
-=-
Modified: DateTime/trunk/src/DateTime/DateTime.py
===================================================================
--- DateTime/trunk/src/DateTime/DateTime.py 2011-05-08 13:57:15 UTC (rev 121594)
+++ DateTime/trunk/src/DateTime/DateTime.py 2011-05-08 14:11:59 UTC (rev 121595)
@@ -440,6 +440,8 @@
raise SyntaxError('Unable to parse %s, %s' % (args, kw))
def __getstate__(self):
+ # We store a float of _micros, instead of the _micros long, as we most
+ # often don't have any sub-second resolution and can save those bytes
return (self._micros / 1000000.0, self._timezone_naive, self._tz)
def __setstate__(self, value):
More information about the checkins
mailing list