Do not override built-in Python function#486
Do not override built-in Python function#486kdeldycke wants to merge 2 commits intopython-babel:masterfrom kdeldycke:rename-builin-functions
Conversation
|
Marked milestone as Babel 3: This is a semver-major change since people may be (and probably are) currently calling functions with a named |
|
@akx: makes sense! I'll be happy to revisit it on the future once the time has come. |
|
There's nothing wrong with a function keyword arg with the same name as a Python builtin if that function doesn't use the builtin. The Python source code does this https://docs.python.org/3/library/http.server.html#http.server.BaseHTTPRequestHandler.log_message https://github.com/python/cpython/blob/5e0ce46aeb13f31e4dbe6a2891f583e770e0a808/Lib/http/server.py#L561 |
|
This PR is severely outdated and as @verhovsky pointed out 3 years ago, even if it's a bad pattern, redefining Python builtins works. And with Babel adopting I propose to close this PR for good to clean the backlog. |
format()is a Python bult-in function. To avoid collission and override of this default function, I just renamed all instance offormatvariables topattern.For reference, here is the script I used to perform this renaming: