Alexander Belopolsky
6c7a4182f5
Closes issue #20858 : Enhancements/fixes to pure-python datetime module
This patch brings the pure-python datetime more in-line with the C
module. Patch contributed by Brian Kearns, a PyPy developer. PyPy
project has been running these modifications in PyPy2 stdlib.
This commit includes:
- General PEP8/cleanups;
- Better testing of argument types passed to constructors;
- Removal of duplicate operations;
- Optimization of timedelta creation;
- Caching the result of __hash__ like the C accelerator;
- Enhancements/bug fixes in tests.
12 years ago
Serhiy Storchaka
465e60e654
Issue #22033 : Reprs of most Python implemened classes now contain actual
class name instead of hardcoded one.
12 years ago
Benjamin Peterson
ee6bdc07d6
remove the ability of datetime.time to be considered false ( closes #13936 )
12 years ago
Benjamin Peterson
da0bea213d
improve comment
13 years ago
Benjamin Peterson
f908efb75c
make lists uniformly integers for the benefit of pypy
13 years ago
Serhiy Storchaka
9594942716
Issue #18783 : Removed existing mentions of Python long type in docstrings,
error messages and comments.
13 years ago
Ezio Melotti
30b9d5d3af
#18705 : fix a number of typos. Patch by Févry Thibault.
13 years ago
Brett Cannon
cd171c8e92
Issue #18200 : Back out usage of ModuleNotFoundError (8d28d44f3a9a)
13 years ago
Brett Cannon
0a140668fa
Issue #18200 : Update the stdlib (except tests) to use
ModuleNotFoundError.
13 years ago
Ezio Melotti
f756f947f9
#17571 : remove broken links in datetime.py docstring.
13 years ago
Victor Stinner
765531d2d0
Issue #17516 : use comment syntax for comments, instead of multiline string
13 years ago
Alexander Belopolsky
3ec153681e
Issue #15973 : Fixed segmentation fault on timezone comparison to other types.
14 years ago
Georg Brandl
0085a24075
Closes #15973 : fix a segmentation fault when comparing timezone objects.
14 years ago
Alexander Belopolsky
93c9cd07b6
Issue #9527 : tm_gmtoff has 'correct' sign.
14 years ago
Alexander Belopolsky
ff493c9c46
Issue #9527 : datetime.astimezone() method will now supply a class
timezone instance corresponding to the system local timezone when
called with no arguments.
14 years ago
Alexander Belopolsky
fdc860f310
Issue #9527 : datetime.astimezone() method will now supply a class
timezone instance corresponding to the system local timezone when
called with no arguments.
14 years ago
Alexander Belopolsky
0831382d69
Issue #15006 : Allow equality comparison between naive and aware time
or datetime objects.
14 years ago
Alexander Belopolsky
016ef551a7
Removed redundant code
14 years ago
Alexander Belopolsky
a4415141da
Issue #2736 : Added datetime.timestamp() method.
14 years ago
Victor Stinner
5d272cc6a2
Close #14180 : Factorize code to convert a number of seconds to time_t, timeval or timespec
time.ctime(), gmtime(), time.localtime(), datetime.date.fromtimestamp(),
datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp() now
raises an OverflowError, instead of a ValueError, if the timestamp does not fit
in time_t.
datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp() now
round microseconds towards zero instead of rounding to nearest with ties going
away from zero.
14 years ago
Ezio Melotti
e130a52d8a
Remove duplication.
15 years ago
Alexander Belopolsky
89da349b7b
Issue #11930 : Remove year >= 1000 limitation from datetime.strftime.
Patch by Victor Stinner.
15 years ago
Alexander Belopolsky
b6f5ec7370
Issue #11576 : Fixed timedelta subtraction glitch on big timedelta values
15 years ago
Alexander Belopolsky
b8bb4664fc
Issue #1777412 : extended year range of strftime down to 1000.
15 years ago
Alexander Belopolsky
1bcbaab15a
Issue 9183: Intern UTC timezone.
16 years ago
Alexander Belopolsky
3e62f78c4e
Fixed microsecond rounding in python version of utcfromtimestamp
16 years ago
Alexander Belopolsky
aeb039863d
Make python version of fromtimestamp behave more like C.
16 years ago
Alexander Belopolsky
a565874cc1
Use _datetime docstring if _datetime is available.
16 years ago
Alexander Belopolsky
cf86e368eb
Issue #7989 : Added pure python implementation of the datetime module.
16 years ago