Movatterモバイル変換


[0]ホーム

URL:


Deprecate self

Marcin 'Qrczak' Kowalczykqrczak at knm.org.pl
Wed Apr 18 13:53:56 EDT 2001


Wed, 18 Apr 2001 14:40:41 GMT, Rainer Deyke <root at rainerdeyke.com> pisze:> The thing that bothers me about using 'self' is that it is inconsistent.So let's allow    def self.method(arg1, arg2):to have the definition syntax consistent with a call.> The relationship of a method to the object on which it is called> is analogous to the relationship between a free function and its> module, yet only the former supports the 'self.x' convention.Indeed there is a correspondence.The difference is that the function will get an object as an additionalargument if it's obtained from a class, but it won't get anything ifit's obtained from a module (the "anything" would have to be relatedto the module as instance is related to its class, and there is evenno such thing).The syntactic difference is a result of a semantic difference.--  __("<  Marcin Kowalczyk *qrczak at knm.org.plhttp://qrczak.ids.net.pl/ \__/  ^^                      SYGNATURA ZASTĘPCZAQRCZAK


More information about the Python-listmailing list

[8]ページ先頭

©2009-2025 Movatter.jp