Eugene van der Pijll wrote:
>"Datetime" just means one point in time; it is not something that is
>observed.

Yes.  An offset (plus short name and DST flag) is observed.
The "_for_datetime" bit indicates the argument format, just like
"offset_for_datetime".

>What do you think of: "next_offset_transition"? Or even
>"next_transition", as it is always called on a timezone object, and it
>should be clear in that context what it is a transition of.

The latter is better, because it's not just the offset that transitions.
In some cases there is a transition without the offset changing, as for
example when the UK changed from British Summer Time to British Standard
Time, when the is_dst flag was the only thing that changed.

But with the "_transition" naming pattern there's a problem for the
names of the other two methods.  Logically the "prev_transition" could be
the start of the current or previous observance.  And "this_transition"
is meaningless.  If you want to drop the "_for_datetime" bit then just
go to "{prev,this,next}_observance_start": it is the observance, not
the transition, that is the referent of "this" and the others.

-zefram

Reply via email to