On 08/18/2015 12:41 PM, Alexander Belopolsky wrote: > > On Tue, Aug 18, 2015 at 2:22 PM, Carl Meyer <[email protected] > <mailto:[email protected]>> wrote: [snip] > But I still think I could figure out whether to use later=True or > later=False more easily than I could figure out whether to use fold=True > or fold=False (in both cases really, but especially in the gap case). > > I am not sure Raymod Hettinger is receiving these emails, so I added him > to "bcc". It will be good to have an input from people with teaching > experience. The problem with "hardcoding" the temporal relationship in > the name of the flag is that for a missing time `t` you get a > counter-intuitive t.replace(later=True) - t.replace(later=False) < 0. > On one hand, this strongly suggests that something is wrong with `t`, > but also invites a question why not make this an error? A "gap" is a > negative "fold" rule may not be much better in terms of teachability, > but it is hard to judge it without an actual teaching experience.
`t.replace(later=True) - t.replace(later=False) < 0` certainly seems wrong, but why would it be implemented that way? I now see that your PEP text specifies the same "backwards from the plain sense of the flag" behavior with `first` as the flag: "The value returned by dt.timestamp() given a missing dt will be the larger of the two "nice to know" values if dt.first == True and the smaller otherwise." Why not simply flip the sense of that sentence so that `later` always means the later of the two possible resolutions? Carl
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Datetime-SIG mailing list [email protected] https://mail.python.org/mailman/listinfo/datetime-sig The PSF Code of Conduct applies to this mailing list: https://www.python.org/psf/codeofconduct/
