![](https://secure.gravatar.com/avatar/eee4c7c3a8774e10b4c4cb77a79fd92a.jpg?s=120&d=mm&r=g)
Sept. 20, 2023
3:09 p.m.
Hello, I had an idea for a new type annotation called "View" type hint to indicate attributes that are readable both internally and externally but should only be writable internally. Example usage: from typing import View class MyClass: def __init__(self) -> None: self.my_attr: View[int] = 0 This is equivalent to below from a static type checker's point of view. class MyClass: def __init__(self) -> None: self._my_attr = 0 @property def my_attr(self) -> int: return self._my_attr