A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/080388.html below:

Deprecate self

Deprecate selfMarcin 'Qrczak' Kowalczyk qrczak 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 additional
argument if it's obtained from a class, but it won't get anything if
it's obtained from a module (the "anything" would have to be related
to the module as instance is related to its class, and there is even
no such thing).

The syntactic difference is a result of a semantic difference.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4