This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 658254: accept None for time.ctime() and friends
Type: Stage:
Components: Extension Modules Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fdrake Nosy List: blunck2, brett.cannon, fdrake, nnorwitz, rhettinger
Priority: normal Keywords: patch

Created on 2003-01-07 03:42 by blunck2, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_time.diff blunck2, 2003-01-08 03:35 contextual diff for a unit test
timemodule.diff blunck2, 2003-01-08 03:36 contextual diff for actual implementation change
libtime.diff blunck2, 2003-01-08 04:24 contextual diff for libtime.tex
NEWS.diff blunck2, 2003-01-08 04:25 contextual diff for NEWS
Messages (5)
msg42350 - (view) Author: Christopher Blunck (blunck2) Date: 2003-01-07 03:42
ctime(), gmtime(), and localtime() now support None and
treat it as tho you passed no arguments at all.

i am new to patching for py and am not sure if there
are unit tests i should update.  please advise...
msg42351 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-01-07 22:33
Logged In: YES 
user_id=33168

There don't appear to be any direct tests, but it would
still be nice to call the functions and verify they work ok.
 You could compare that abs(ctime() - ctime(None)) < .5, for
example.  Look in Lib/test/test_time.py.

Also, the docs need to be updated, see Doc/lib/libtime.tex.
 That should be updated, ie change \optional(secs) with
\optional{secs\code{ = None}}.  Also, an entry in Misc/NEWS
should be added since this is an API change.

There is no attached file.
msg42352 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-07-06 20:38
Logged In: YES 
user_id=357491

What do people think of this functionality?  I personally don't see a 
need for it.
msg42353 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-07-02 07:04
Logged In: YES 
user_id=80475

Fred, here is Blunk's patch.
msg42354 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2004-08-03 18:01
Logged In: YES 
user_id=3066

I'm afraid I've let too much time to go by for this to apply
cleanly (my fault; sorry!).  I've applied portions of the
documentation and news patches, and replaced the
implementation and test patches in my commit.

Doc/lib/libtime.tex  1.65
Lib/test/test_time.py  1.18
Misc/NEWS  1.1065
Modules/timemodule.c  2.144
History
Date User Action Args
2022-04-10 16:06:07adminsetgithub: 37731
2003-01-07 03:42:17blunck2create