On Sat, Apr 23, 2022 at 06:41:23AM -0000, Mehdi2277 wrote:
> My main question for this approach is how would this work with type
> checkers? Is there any restriction that forward class's continuation
> must appear in same module? If it's allowed that a forward class may
> be continued in a different module I do not see how type checker like
> mypy/pyright could handle that.
Larry said that the name that follows `continue class` is an expression,
so that something like this is allowed:
import mymodule
continue class mymodule.X:
def method(self):
pass
so yes, you can continue classes in other modules. He said that could be
used as a very primitive form of separation of interface and
implementation, by putting the `forward class` in one module and the
`continue` in another.
--
Steve
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/N3YIF2FJARSE73M6VJX6UNU776FS6QC4/
Code of Conduct: http://python.org/psf/codeofconduct/