Re: Please Explain This Error

[email protected]
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <OF6E4CCF06.8FBF21B9-ON8525721A.007823A7-8525721A.007859B8@bankofny.com>
As to when and when not to use self.

If you are in a class, self is needed, plus you need to pass self into
your function.

When you are in functions or a script self cannot be used.

That is the basic rule of thumb that I use, but I also tend to use
classes, modules that are not declared as classes do not need the self,
at least I don't think they are, I tend to put it in or leave it out and
only change it when the compiler/interpreter complains :)

Thanks,

Greg Givler
Information Technology
Lockwood®
10 Valley Stream Parkway
Malvern, PA 19355
Phone: (484) 605-4826
Email: [email protected]


                                                                                                                                           
                      Rich Shepard                                                                                                         
                      <rshepard@appl-ecosys        To:       "For users of the pysqlite database module." <pysqlite-IAPFreCvJWPBWskQ1e/[email protected]>       
                      .com>                        cc:                                                                                     
                      Sent by:                     Subject:  Re: [pysqlite] Please Explain This Error                                      
                      pysqlite-bounces@list                                                                                                
                      s.initd.org                                                                                                          
                                                                                                                                           
                                                                                                                                           
                      11/02/2006 04:26 PM                                                                                                  
                      Please respond to                                                                                                    
                      "For users of the                                                                                                    
                      pysqlite database                                                                                                    
                      module."                                                                                                             
                                                                                                                                           
                                                                                                                                           




On Thu, 2 Nov 2006, [email protected] wrote:

> Just saw you bug, you have self.cur, then you say cur.fetchone() it
> should be self.cur.fetchone()

   Excellent suggestion, Greg. But, cur.fetchone() is on line 129 (now)
and
the error is still on the line above with the 'self.cur.execute(...'.

   I think that I tried that, too, before writing. I'm still getting
used to
knowing where I need to specify the specific object using 'self' and
when I
don't.

Rich

--
Richard B. Shepard, Ph.D.               |    The Environmental
Permitting
Applied Ecosystem Services, Inc.(TM)    |            Accelerator
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax:
503-667-8863
_______________________________________________
pysqlite mailing list
pysqlite-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/pysqlite

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please call the help desk at ext 4850
______________________________________________________________________




______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.