On 2017-02-12 14:01, Joao S. O. Bueno wrote: > On 12 February 2017 at 14:51, Markus Meskanen <markusmeska...@gmail.com> > wrote: >> 1. Allowing the class to be used in the method's header, f.e. for typing and >> decorators: >> >> @decorate(MyClass) >> def MyClass.method(self, other: MyClass) -> List[MyClass]: >> ... >> >> This is useful since you can't refer the class itself inside of its body. At >> the moment the way to use typing is to write the class's name as a string... >> It feels awful. > You realize now that if we accept this change, and given your example, > any "well behaved" Python code with markup will in a couple months > required to be like > > class MyClass: > """Docstring.""" > > def MyClass.__init__(self: MyClass, ...) -> None: > ... > > # add other methods here.
I am for method-outside-of-class form: If it is allowed, I will use it extensively: * instance methods and extension methods have the same form * less lines between the line you are looking at and the name of the class * explicit class name helps with searching for methods * reduces indentation thanks _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/