Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #13311

method:wrong structure

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!news.wiretrip.org!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <1248283536@qq.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.017
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'skip:l 60': 0.09; 'subject:method': 0.09; 'output': 0.10; 'def': 0.15; 'argument': 0.15; 'run(self):': 0.16; 'skip:# 60': 0.16; 'subject:wrong': 0.16; 'to:name:python-list': 0.18; 'defined': 0.19; 'skip:_ 20': 0.28; 'fix': 0.29; 'typeerror:': 0.30; 'class': 0.30; "can't": 0.33; 'there': 0.33; 'to:addr:python-list': 0.33; 'header:Mime- Version:1': 0.39; 'why': 0.39; 'to:addr:python.org': 0.39; 'subject: ': 0.73; 'subject::': 0.87
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s0907; t=1316075333; bh=Gc507BlPPh7rRa6eS6LMkgH0hsNOhv0yylZitq9OjuU=; h=Received:X-QQ-SSF:X-QQ-BUSINESS-ORIGIN:X-Originating-IP: X-QQ-STYLE:X-QQ-mid:From:To:Subject:Mime-Version:Content-Type: Content-Transfer-Encoding:Date:X-Priority:Message-ID:X-QQ-MIME: X-Mailer:X-QQ-Mailer; b=TzbNA44YQEGeWFmCDpk2xFJjJK+gTxDXFmtt2kRckpgs/yV9Igxy6ovHkWPR3iDv1 XnLfLvoS3NZx4at6/Hgxf3rP9+6Z1SnX25i77+xEvkGn1fnHEp6LEJFJDA/D/we
X-QQ-SSF 00000000000000F0000000000000000
X-QQ-BUSINESS-ORIGIN 2
X-Originating-IP 113.91.29.134
X-QQ-STYLE
X-QQ-mid webmail493t1316075332t8778725
From "守株待兔" <1248283536@qq.com>
To "python-list" <python-list@python.org>
Subject method:wrong structure
Mime-Version 1.0
Content-Type multipart/alternative; boundary="----=_NextPart_4E71B743_DF1C2770_3FC5BF1E"
Content-Transfer-Encoding 8Bit
Date Thu, 15 Sep 2011 16:28:51 +0800
X-Priority 3
X-QQ-MIME TCMime 1.0 by Tencent
X-Mailer QQMail 2.x
X-QQ-Mailer QQMail 2.x
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1154.1316075346.27778.python-list@python.org> (permalink)
Lines 88
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1316075346 news.xs4all.nl 2429 [2001:888:2000:d::a6]:60908
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:13311

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

there are  three  programs,all of them  left  main  structure,
code0 is ok,i don't know why code2 and code3 can't run,how to fix them?
code0
class   webdata(object):
    def  __init__(self,arg):
          
    def  loadequity(self):
            
    def  loadoption(self):
    
    #loadstatus={'equity':self.loadequity(),'option':self,loadoption()}
  
    def  run(self):      
        
if  __name__=="__main__":
     s=webdata('equity').run()
     s.loadequity()   

code1
class   webdata(object):
    def  __init__(self,arg):
          
    def  loadequity(self):
            
    def  loadoption(self):
    
    loadstatus={'equity':self.loadequity(),'option':self,loadoption()}
  
    def  run(self):        
        
  
if  __name__=="__main__":
     s=webdata('equity').run()
     loadstatus['equity']

wrong output is 
name 'self' is not defined


code2
class   webdata(object):
    def  __init__(self,arg):
          
    def  loadequity(self):
            
    def  loadoption(self):
    
    loadstatus={'equity':loadequity(),'option':loadoption()}
  
    def  run(self):      
        
if  __name__=="__main__":
     s=webdata('equity').run()
     s.loadequity() 

wrong output is :
TypeError: loadequity() takes exactly 1 argument (0 given)

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

method:wrong  structure "守株待兔" <1248283536@qq.com> - 2011-09-15 16:28 +0800

csiph-web