On Tue, May 25, 2021 at 4:41 PM Shreyan Avigyan <pythonshreya...@gmail.com> wrote:
> First it would seem useless or not necessary but soon this becomes clear. > 1) It would help programmers debug their code easily and help them find out > that the bug's not in the constant, A reasonable type checker will detect cases where typing.Final annotated bindings are reassigned. For example, with mypy: https://mypy.readthedocs.io/en/stable/final_attrs.html If mypy is not catching cases of rebinding, then that would likely be treated as a bug by the maintainers. If you want help with debugging code, then a type checker will help with that. > that's for sure. 2) This would allow another branch of OOP programming to > enter Python. Read-only member variables. see above, this is already provided by mypy There are Private members in Java and C++. But I believe they are not their > to hide things. They are there to debug. > There are private methods in python too, just not enforced by the runtime, instead enforced by the myriad developer/debug tooling out there in the form of linters/checkers. > _______________________________________________ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/PU4DFQRCAEXXQVECJ3IIZQK2UQLAENCX/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/FXYIPGOM2FX6PH6NJGOELXSPWS3ZLCRU/ Code of Conduct: http://python.org/psf/codeofconduct/