Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Gabriel Genellina
At Thursday 4/1/2007 23:52, jeremito wrote: I am writing a class that is intended to be subclassed. What is the proper way to indicate that a sub class must override a method? If any subclass *must* override a method, raise NotImplementedError in the base class (apart from documenting how yo

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Thomas Ploch
Gabriel Genellina schrieb: > At Thursday 4/1/2007 23:52, jeremito wrote: > >> I am writing a class that is intended to be subclassed. What is the >> proper way to indicate that a sub class must override a method? > > If any subclass *must* override a method, raise NotImplementedError in > the ba

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread jeremito
Gabriel Genellina wrote: > At Thursday 4/1/2007 23:52, jeremito wrote: > > >I am writing a class that is intended to be subclassed. What is the > >proper way to indicate that a sub class must override a method? > > If any subclass *must* override a method, raise NotImplementedError > in the base

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Grant Edwards
On 2007-01-05, Thomas Ploch <[EMAIL PROTECTED]> wrote: >>> I am writing a class that is intended to be subclassed. What >>> is the proper way to indicate that a sub class must override a >>> method? >> >> If any subclass *must* override a method, raise >> NotImplementedError in the base class (a

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Thomas Ploch
Grant Edwards schrieb: > On 2007-01-05, Thomas Ploch <[EMAIL PROTECTED]> wrote: > I am writing a class that is intended to be subclassed. What is the proper way to indicate that a sub class must override a method? >>> If any subclass *must* override a method, raise >>> NotImplement

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Carl Banks
jeremito wrote: > I am writing a class that is intended to be subclassed. What is the > proper way to indicate that a sub class must override a method? You can't (easily). If your subclass doesn't override a method, then you'll get a big fat AttributeError when someone tries to call it. But thi

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Grant Edwards
On 2007-01-05, Thomas Ploch <[EMAIL PROTECTED]> wrote: >>> I learn so much from this list. I didn't even know this error >>> existed. >> >> And remember: even if it didn't, you could have created your >> own: > > Erm, it wasn't me who asked. I just wanted to say that I didn't know > that there is

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread belinda thom
On Jan 4, 2007, at 7:56 PM, Thomas Ploch wrote: > Gabriel Genellina schrieb: >> At Thursday 4/1/2007 23:52, jeremito wrote: >> >>> I am writing a class that is intended to be subclassed. What is the >>> proper way to indicate that a sub class must override a method? >> >> If any subclass *must*

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread belinda thom
On Jan 4, 2007, at 9:28 PM, Carl Banks wrote: > jeremito wrote: >> I am writing a class that is intended to be subclassed. What is the >> proper way to indicate that a sub class must override a method? > > You can't (easily). > > If your subclass doesn't override a method, then you'll get a big

Undefined symbol __pure_virtual when importing MySQLdb

2007-01-04 Thread [EMAIL PROTECTED]
I downloaded MySQL-python-1.2.1 from SourceForge and installed it on a Mandrake system (Mandrake Linux 9.2 3.3.1-2mdk on linux2). The installation was successful. The gcc version is 3.3. My Python version is 2.4.2. When I import MySQLdb, I get an error which says that __pure_virtual is an undef

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Dan Bishop
On Jan 4, 11:57 pm, belinda thom <[EMAIL PROTECTED]> wrote: ... > So, back to my question: is a catalog of standard python errors > available? I've looked on the python site but had no success. >>> [name for name in dir(__builtins__) if name.endswith('Error')] ['ArithmeticError', 'AssertionError',

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Robert Kern
belinda thom wrote: > I imagine the NotImplementedError is actually a defined object, but I > really don't know. It is. > So, back to my question: is a catalog of standard python errors > available? I've looked on the python site but had no success. http://docs.python.org/lib/module-excepti

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Paddy
belinda thom wrote: > On Jan 4, 2007, at 9:28 PM, Carl Banks wrote: > > > jeremito wrote: > >> I am writing a class that is intended to be subclassed. What is the > >> proper way to indicate that a sub class must override a method? > > > > You can't (easily). > > > > If your subclass doesn't ove

Re: Anyone persuaded by "merits of Lisp vs Python"?

2007-01-04 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > [3] I thought it was particularly cool how Tcl could bolt on a class > based object oriented system as a library. The word "class" isn't > built into the language, but that kind of evaluator lets you add it. I have written about two notr

Re: Anyone persuaded by "merits of Lisp vs Python"?

2007-01-04 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Paul Hummer wrote: > I learned PHP for ease of web application development ... PHP is great for easily developing _insecure_ web applications. But if you want them not to leak like a sieve, things get a bit more complicated. -- http://mail.python.org/mailman/listi

Re: Undefined symbol __pure_virtual when importing MySQLdb

2007-01-04 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I have googled hard, and did see someone asking the same question, but > haven't found a good solution to this problem. Could anyone give me a > hint? Thanks a lot! googling for "undefined symbol: __pure_virtual" brings up hundreds of posts on this topic, and the ans

Re: How do I add users using Python scripts on a Linux machine

2007-01-04 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Piet van Oostrum wrote: > The scenario is as follows: Suppose the script starts with the line: > #!/usr/bin/python > > (using #!/usr/bin/env python would be disastrous because the user could > supply his own `python interpreter' in his PATH.) > > Now a malicious u

Re: Undefined symbol __pure_virtual when importing MySQLdb

2007-01-04 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > I have googled hard, and did see someone asking the same question, but > > haven't found a good solution to this problem. Could anyone give me a > > hint? Thanks a lot! > > googling for "undefined symbol: __pure_virtual" brings up hundreds of

Re: cache line length of a machine

2007-01-04 Thread Tim Roberts
"John" <[EMAIL PROTECTED]> wrote: > >How do I find out the cache line length of a machine in python? How would that piece of information be valuable in Python? There isn't anything you can do to take advantage of it in Python. You can look up the L2 and L3 cache size and speed using WMI (assumin

<    1   2