Isn't there supposed to be only one obvious way of doing these things?
Isn't there supposed to be only one obvious way of doing these things?
See it as deferred refactoring for library maintainers. Library maintainers that work in a monorepo with their users get this refactoring feature for free.
And also, the issue isn't really with library maintainers when it comes to Python syntax changes. It's with all the user code written in Python. I tried converting my programs from Scala 2.12 from 2.13, and I failed so hard. I couldn't justify the time commitment, even with tools like scalafix to automate stuff. It's just not that smart.
All this is to say, let's not pretend that breaking changes to a programming language are ok. If you have to do break stuff once or twice in the lifetime of your language, fine. But accepting breaking changes as the status-quo is a failure of a language, by definition, IMO.
Deprecated language features are, by definition, still present and need no special incantation to miss, though they may produce Deprecation warnings to encourage you to update your code. Removed features would, I guess, be something you could do this for, except that generally the whole benefit of removing features is getting rid of the supporting code and the effort of maintaining it and it's interactions with new code.
There is a huge benefit to keeping existing code working as it is. Both for businesses and the ecosystem. It benefits everyone if the language does everything it can to keep that intact.
greeting = "hello {}"
greet = partial(str.format, greeting)
greet("world")
How would you pass a variable format string to f"" ? >>> flt = 1.2345
>>> two = 2
>>> f"{flt:.{two}f}"
'1.23' greet = lambda x: f"hello {x}" greet = lambda x: f"hello {x}"Surely this would not work:
greeting = "hello {x}"
greet = lambda x: f greeting code = 'f"{input()} {x}"'
lambda x: eval(code)
(Please don't do this) code = 'f"here it is {eval(input())}"'
(lambda: eval(code))()
k, there we go greet_fstring = partial(lambda _,s: f"hello {s}", greeting) greet = partial(str.format, greeting)
greet("world")
as opposed to just greeting.format("world")
? greet = greeting.format