Movatterモバイル変換


[0]ホーム

URL:


calling superclass' method with list positional arg

Marcin 'Qrczak' Kowalczykqrczak at knm.org.pl
Fri Apr 13 06:12:19 EDT 2001


Fri, 13 Apr 2001 15:44:10 +0700, Steven Haryanto <steven at haryan.to> pisze:>      def __init__(self, *items):>          # do something else first...>>          # then pass the items to superclass' constructor>          args = list(items)>          args.insert(0, self)>          apply(Bag.__init__, args)def __init__(self, *items):    # do something else first...    apply(Bag.__init__, (self,) + args)Writing "tuple + tuple" concatenates tuples.--  __("<  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