New submission from parsa mpsh <parsam...@gmail.com>:

python raises error `Undefined class X` when you declaring parameter type or 
return type of method as the self of class:

class MyClass:
    def mymethod(self, a: MyClass): # parameter type is class self
        pass

# or

class MyClass:
    def mymethod(self) -> MyClass: # return type is class self
        pass
# or both of them

error `Undefined class ...` will be raised.

----------
messages: 382061
nosy: parsampsh
priority: normal
severity: normal
status: open
title: Cannot declare method or static function parameter or return type as 
self of the class
type: behavior
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42503>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to