I would like to prevent function arguments being reassigned in Python, like Java's final or C's const modifer. For example, the following code should not be considered valid: def update_bars_in_foos(foo: Foo, bars: List[str]): foos = foo.get_all_foos() for foo in foos: # <- this should be a linting/type error - reasssignment of foo foo.bar = ', '.join(bars) I understand that it's not possible to prevent this during runtime. Type annotations offer typing.Final, however it is specifically disallowed for function arguments: Final may only be used as the outermost type in assignments or variable annotations. Using it in any other position is an error. 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? I'd be happy with an equivalent to ESLint's no-param-reassign rule. Continue reading...