[Python-Dev] Re: str() vs format(): trivia question

2021年4月26日 16:31:51 -0700

On 4/20/21 2:11 PM, MRAB wrote:
> On 2021年04月20日 20:42, Ethan Furman wrote:
>> The deprecation period will give that user, and others like them, time to 
add their own Enum base classes with the
>> `__format__` method they desire.
>
> Couldn't the format accept 'd' if they want an int, i.e. f"{Color.RED:d}"?
Yes, in fact. And that even works now. Thanks!
--
~Ethan~
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/7VUAJMEJVY2K5BO5WKLDCMDGSVBCJC7Q/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to