]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Improve documentation for TimezoneTransition
authorAarni Koskela <akx@iki.fi>
Tue, 25 Jan 2022 13:30:30 +0000 (15:30 +0200)
committerAarni Koskela <akx@iki.fi>
Tue, 25 Jan 2022 13:30:30 +0000 (15:30 +0200)
Fixes #823

babel/dates.py
docs/api/dates.rst

index 816149d18be49a7d83d2773b2ed39efdd5fc727a..f94c60a0d3f8c7fc90e2b17c5d21e3b35d370aec 100644 (file)
@@ -255,17 +255,22 @@ def get_next_timezone_transition(zone=None, dt=None):
 class TimezoneTransition(object):
     """A helper object that represents the return value from
     :func:`get_next_timezone_transition`.
+
+    :field activates:
+        The time of the activation of the timezone transition in UTC.
+    :field from_tzinfo:
+        The timezone from where the transition starts.
+    :field to_tzinfo:
+        The timezone for after the transition.
+    :field reference_date:
+        The reference date that was provided.  This is the `dt` parameter
+        to the :func:`get_next_timezone_transition`.
     """
 
     def __init__(self, activates, from_tzinfo, to_tzinfo, reference_date=None):
-        #: the time of the activation of the timezone transition in UTC.
         self.activates = activates
-        #: the timezone from where the transition starts.
         self.from_tzinfo = from_tzinfo
-        #: the timezone for after the transition.
         self.to_tzinfo = to_tzinfo
-        #: the reference date that was provided.  This is the `dt` parameter
-        #: to the :func:`get_next_timezone_transition`.
         self.reference_date = reference_date
 
     @property
index f3e59b63bf49af1c136ac83c45f31ec5d8a53487..55ea2b16ca85e7e865c225863bbd257ccb7aeee9 100644 (file)
@@ -42,6 +42,8 @@ Timezone Functionality
 
     A timezone object for the computer's local timezone.
 
+.. autoclass:: TimezoneTransition
+
 Data Access
 -----------