diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-12-24 16:30:58 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-12-24 16:30:58 (GMT) |
commit | 2483b61e03ccc29c736d66c53a6e9652a9edc9a1 (patch) | |
tree | d644b780004d593756d00bb4bd77d5705623f81c /Doc | |
parent | 1cff9fc97c94be362c0ecdcb1386094bcc4b5ee8 (diff) | |
download | cpython-2483b61e03ccc29c736d66c53a6e9652a9edc9a1.zip cpython-2483b61e03ccc29c736d66c53a6e9652a9edc9a1.tar.gz cpython-2483b61e03ccc29c736d66c53a6e9652a9edc9a1.tar.bz2 |
Added note about technical pickle limitation on tzinfo instances.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libdatetime.tex | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/lib/libdatetime.tex b/Doc/lib/libdatetime.tex index 82c852d..b061d90 100644 --- a/Doc/lib/libdatetime.tex +++ b/Doc/lib/libdatetime.tex @@ -755,9 +755,14 @@ The latter objects view their fields as being in local time, and the from UTC, the name of the time zone, and DST offset, all relative to a date or time object passed to them. +Special requirement for pickling: A tzinfo subclass must have an +\method{__init__} method that can be called with no arguments, else it +can be pickled but possibly not unpickled again. This is a technical +requirement that may be relaxed in the future. + A concrete subclass of \class{tzinfo} may need to implement the following methods. Exactly which methods are needed depends on the -uses made of aware \class{datetime} objects; if in doubt, simply +uses made of aware \module{datetime} objects; if in doubt, simply implement all of them. The methods are called by a \class{datetimetz} or \class{timetz} object, passing itself as the argument. A \class{tzinfo} subclass's methods should be prepared to accept a dt |