[
https://issues.apache.org/jira/browse/AIRFLOW-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16807540#comment-16807540
]
ASF GitHub Bot commented on AIRFLOW-4034:
-----------------------------------------
Fokko commented on pull request #4861: [AIRFLOW-4034] Make string formatting
explicit by removing **locals()
URL: https://github.com/apache/airflow/pull/4861
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Make string formatting explicit by removing locals()
> ----------------------------------------------------
>
> Key: AIRFLOW-4034
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4034
> Project: Apache Airflow
> Issue Type: Improvement
> Reporter: Bas Harenslak
> Priority: Major
>
> Best practice for Python is generally to write explicit and readable code.
> With this mindset, it's preferable to string format like this:
> {code:java}
> mystring = "{var1} {var2}".format(var1=myobject.something,
> var2=somethingelse){code}
> Instead of:
> {code:java}
> mystring = "{var1} {var2}".format(**locals()){code}
> Because it makes string formatting explicit and is readable to the reader of
> the code what variables are used in the string format.
> So, I suggest to remove all **locals() string formatting.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)