jmcarp commented on a change in pull request #4685: [AIRFLOW-3862] Check types
with mypy.
URL: https://github.com/apache/airflow/pull/4685#discussion_r255788477
##########
File path: airflow/bin/cli.py
##########
@@ -1665,9 +1665,17 @@ def sync_perm(args):
dag.access_control)
-Arg = namedtuple(
- 'Arg', ['flags', 'help', 'action', 'default', 'nargs', 'type', 'choices',
'metavar'])
-Arg.__new__.__defaults__ = (None, None, None, None, None, None, None)
+class Arg(object):
Review comment:
`mypy` doesn't understand `namedtuple` default arguments set via
`__new__.__defaults`, so when we instantiate `Arg` below with missing
arguments, `mypy` complains. I think `mypy` understands the `namedtuple`
default syntax in python >=3.6, but not this syntax.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services