[Datetime-SIG] Making dt parameter of timezone.tzname(dt) optional

Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Sep 9 20:30:21 CEST 2015


On Wed, Sep 9, 2015 at 1:58 PM, Tim Peters <tim.peters at gmail.com> wrote:

> +0 on the original proposal (doesn't really matter to me
> either way, but I have a mild preference for allowing a simplification
> ("require less") in the `timezone` subclass).
>

What would you say for the following proposal: leave tzinfo.tzname()
signature as is, but add

def name(self, dt=None):
    return self.tzname(dt)

to the base tzinfo class.  Now `tzname()` is a hook for tzinfo
implementers, but name() is the higher level function for the users.  (Note
that I never liked that datetime.tzname() and tzinfo.tzname() had the same
method name, so my proposal may reflect a personal bias.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150909/80b9d489/attachment.html>


More information about the Datetime-SIG mailing list