[issue28819] tzinfo class spacing bug

2016-11-28 Thread SilentGhost
Changes by SilentGhost : -- stage: -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue28819] tzinfo class spacing bug

2016-11-28 Thread B. Liu
B. Liu added the comment: Nevermind, the code I submitted was incomplete/buggy. This is embarrassing. The issue was that I was using an interpreter and a class definition that had spaces was happy to be read incompletely. Attached is working demonstration code that doesn't work as expected whe

[issue28819] tzinfo class spacing bug

2016-11-28 Thread SilentGhost
SilentGhost added the comment: What do you mean by "work" and "does not work"? Both versions raise TypeError, because you're passing epoch to fromtimestamp, but once that's fixed both versions return identical output. Python is not sensitive to empty lines in class definitions, so I'd be surpr

[issue28819] tzinfo class spacing bug

2016-11-28 Thread B. Liu
Changes by B. Liu : -- type: -> behavior versions: +Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28819] tzinfo class spacing bug

2016-11-28 Thread B. Liu
New submission from B. Liu: In Python 2.7, the following works: import datetime ZERO = timedelta(0) class UTC(datetime.tzinfo): """UTC""" # can be configured here def utcoffset(self, dt): return ZERO def tzname(self, dt): return "UTC" def dst(self, dt): return ZERO def