- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.7k
Description
Sometimes we want a method that is public but users can't directly extend by providing a new definition. A simple case is Base.identity, which requires no warning for people to know that it doesn't make sense to create new definitions. Other cases like Base.deepcopy have explicit documentation to override Base.copy or Base.deepcopy_internal instead. However, there's no way to enforce this in code so that an error or warning is raised when a user defines a new method innapropriately.
I think the closest term for this would be freeze. I assume that freezing methods would make the most sense at the module level (e.g., freeze frozen_method1, frozen_method2). To be clear, what I'm proposing is distinct from some of the tools in Base.Experimental related to limiting method specialization by the compiler, and is only limiting explicit new definitions for a method.