Код: Выделить всё
def update_bars_in_foos(foo: Foo, bars: List[str]):
foos = foo.get_all_foos()
for foo in foos: #
Я понимаю, что невозможно предотвратить это во время выполнения. Тип аннотации предлагает тип. Использование его в любой другой позиции является ошибкой. In particular, Final can’t be used in annotations for function arguments
https://peps.python.org/pep-0591/#semantics-and-examples
Since it's impossible to do on type annotations level, is there a Python linter with a rule that would prevent it? Я был бы доволен эквивалентом правила Eslint no-param-reassign
Подробнее здесь: https://stackoverflow.com/questions/763 ... -arguments