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.

Title: 658254: accept None for time.ctime() and friends
Type: Stage:
Components: Extension Modules Versions: Python 2.4
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.

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 

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/

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 

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 

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

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/  1.18
Misc/NEWS  1.1065
Modules/timemodule.c  2.144
Date User Action Args
2022-04-10 16:06:07adminsetgithub: 37731
2003-01-07 03:42:17blunck2create