On 01/22/2017 11:48 AM, Serhiy Storchaka wrote:
On 25.10.16 12:37, Serhiy Storchaka wrote:
Classes that doesn't define the __format__ method for custom PEP 3101
formatting inherits it from parents.
Originally the object.__format__ method was designed as [1]:
def __format__(self, format_spe
On 25.10.16 12:37, Serhiy Storchaka wrote:
Classes that doesn't define the __format__ method for custom PEP 3101
formatting inherits it from parents.
Originally the object.__format__ method was designed as [1]:
def __format__(self, format_spec):
return format(str(self), format_spec)
On 27.10.16 19:59, Steve Dower wrote:
Having the default __format__ behave like this makes me happiest:
def __format__(self, fmt):
return format(str(self), fmt)
My 2c. YMMV. etc.
See issue7994 [1] for arguments against this.
[1] http://bugs.python.org/issue7994
__
On 27Oct2016 0251, Serhiy Storchaka wrote:
On 27.10.16 02:44, Eric V. Smith wrote:
But on the other hand, the existing behavior is well specified and has
been around since object.__format__ was added. I'm not sure it needs
changing. What's the harm in leaving it?
More complicated code. And may
On 27.10.16 02:44, Eric V. Smith wrote:
But on the other hand, the existing behavior is well specified and has
been around since object.__format__ was added. I'm not sure it needs
changing. What's the harm in leaving it?
More complicated code. And maybe this behavior is less intuitive. It
cont
On 10/25/2016 5:37 AM, Serhiy Storchaka wrote:
Classes that doesn't define the __format__ method for custom PEP 3101
formatting inherits it from parents.
Originally the object.__format__ method was designed as [1]:
def __format__(self, format_spec):
return format(str(self), format_s
Classes that doesn't define the __format__ method for custom PEP 3101
formatting inherits it from parents.
Originally the object.__format__ method was designed as [1]:
def __format__(self, format_spec):
return format(str(self), format_spec)
An instance is converted to string and re