[Tutor] Beginners question

Mark Lawrence breamoreboy at gmail.com
Mon Apr 6 08:04:42 EDT 2020


On 06/04/2020 12:10, Alan Gauld via Tutor wrote:
> On 06/04/2020 10:41, Alan Gauld via Tutor wrote:
> 
>>> If you mean the "{first=}" notation, that is very recent. Maybe 3.8?
>>
>> No, I meant the ability to provide a __format__() operation in a class.
>>
> 
> Ok, I modified Peter's code to work in Python 3.6 with the
> format() string method and it worked.
> So obviously __format__ capability has been around for a while.
> I just missed it...
> 

Not by much 
https://docs.python.org/3/whatsnew/3.0.html#pep-3101-a-new-approach-to-string-formatting 
:)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Tutor mailing list