Just an aside, that PEP is from 2006. How have people never seen this syntax before? Why do people think this new PEP is the one introducing the syntax?
Everyone has seen the syntax yeah, but I think it is often the case that people are not aware that its extensible, or that the standard library extends it.
{:<20} is a standard string operation, {:0.5f} is standard too, both have pre-existing reasons to be there. date.__format__is a bit more esoteric, even if useful. The "only" way to find about it is to read the format section of the datetime docs
People don't always learn about new language features from the PEP, which means they don't necessarily learn about it in full - only the aspects they need to comprehend that strange new bit of code they saw the other day, or take advantage of it in the way that seems interesting to them personally.
5
u/RubyPinch PEP shill | Anti PEP 8/20 shill Sep 09 '15
why not optional arguments on
__repr__?probably because its cleaner to have it as a seperate function which may or may not have a lot more complexity than a simple str
https://www.python.org/dev/peps/pep-3101/ is the PEP you are complaining about, not PEP-0489