Re: Reading a large bz2 textfile exits early

2010-02-21 Thread Norman Rieß
Am 02/21/10 22:09, schrieb Dennis Lee Bieber: On Sat, 20 Feb 2010 23:12:50 +0100, Norman Rieß declaimed the following in comp.lang.python: Hello, i am trying to read a large bz2 compressed textfile using the bz2 module. The file is 1717362770 lines long and 8GB large. Using this code sour

Re: Use eval() safely?

2010-02-21 Thread Steven D'Aprano
On Mon, 22 Feb 2010 18:45:40 +1300, Gregory Ewing wrote: > W. Martin Borgert wrote: > >> def myeval(untrustedinput): >> return eval(untrustedinput, {"__builtins__": None}, >> { "abs": abs, "sin": math.sin }) >> >> Is it possible to define functions or import modules from the

Re: Use eval() safely?

2010-02-21 Thread Gregory Ewing
W. Martin Borgert wrote: def myeval(untrustedinput): return eval(untrustedinput, {"__builtins__": None}, { "abs": abs, "sin": math.sin }) Is it possible to define functions or import modules from the untrusted input string? This is NOT safe as it stands. It still isn't saf

Re: Efficient way to break up a list into two pieces

2010-02-21 Thread Jonathan Gardner
On Sat, Feb 20, 2010 at 10:48 PM, Steven D'Aprano wrote: > On Sat, 20 Feb 2010 21:21:47 -0800, Jonathan Gardner wrote: >> For ten items, though, is it really faster to muck around with array >> lengths than just copying the data over? Array copies are extremely fast >> on modern processors. > > My

PAPER PRESENTATIONS AND SEMIMAR TOPICS.

2010-02-21 Thread miss world
PAPER PRESENTATIONS AND SEMIMAR TOPICS. CHECK OUR VAST PAPER PRESENTATIONS AND SEMIMAR TOPICS INCLUDING PROJECTS FOR FREE AT http://presentationsandseminars.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Mensanator
On Feb 21, 7:39 pm, rantingrick wrote: > Mensanator snipped: """Yeah, I saw that. Funny that something > important like that wasn't part of the announcement. I notice no > mention of Mac OS, so visiting the website was a complete waste of > time on my part, wasn't it?""" > > Oh Mensanator, why you

Re: Problem creating executable, with PyQwt

2010-02-21 Thread Gib Bogle
Thanks David. Someone asked this question on the PyQt mailing list, too: http://www.riverbankcomputing.com/pipermail/pyqt/2010-February/025827.html That's my student, Helvin. I believe it was also asked on the #pyqt IRC channel on freenode. I think I have previously referred people with

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread sstein...@gmail.com
On Feb 21, 2010, at 9:10 PM, Shashwat Anand wrote: > Just got it working in mac. Installing dependencies took a bit though. I used macports and it was only 2 installs: # sudo port install py26-pygtksourceview # sudo port install py26-gtk2 It sure did install a lot of other stuff, like a new g

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Shashwat Anand
Just got it working in mac. Installing dependencies took a bit though. On Mon, Feb 22, 2010 at 7:38 AM, Philip Semanchuk wrote: > > On Feb 21, 2010, at 8:39 PM, rantingrick wrote: > > >> >> Mensanator snipped: """Yeah, I saw that. Funny that something >> important like that wasn't part of the ann

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Philip Semanchuk
On Feb 21, 2010, at 8:39 PM, rantingrick wrote: Mensanator snipped: """Yeah, I saw that. Funny that something important like that wasn't part of the announcement. I notice no mention of Mac OS, so visiting the website was a complete waste of time on my part, wasn't it?""" Oh Mensanator, why

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread rantingrick
Mensanator snipped: """Yeah, I saw that. Funny that something important like that wasn't part of the announcement. I notice no mention of Mac OS, so visiting the website was a complete waste of time on my part, wasn't it?""" Oh Mensanator, why you always so grumpy? I visited your site a few year

Re: Apologies -- Test message

2010-02-21 Thread rantingrick
On Feb 21, 12:49 pm, Dennis Lee Bieber wrote: Note: The author of this message requested that it not be archived. This message will be removed from Groups in 6 days (Feb 28, 12:49 pm). I've not seen a message via Gmane in something like 36 hours... and find it hard to believe this group

Re: Problem creating executable, with PyQwt

2010-02-21 Thread David Boddie
On Monday 22 February 2010 01:17, Gib Bogle wrote: > > > Traceback (most recent call last): >File "ABM15.pyw", line 15, in >File "PyQt4\Qwt5\__init__.pyc", line 32, in >File "PyQt4\Qwt5\Qwt.pyc", line 12, in >File "PyQt4\Qwt5\Qwt.pyc", line 10, in __load >

Re: Is there a way to continue after an exception ?

2010-02-21 Thread Stef Mientki
On 21-02-2010 03:51, Ryan Kelly wrote: On Sun, 2010-02-21 at 13:17 +1100, Lie Ryan wrote: On 02/21/10 12:02, Stef Mientki wrote: On 21-02-2010 01:21, Lie Ryan wrote: On Sun, Feb 21, 2010 at 12:52 AM, Stef Mientki wrote: hello, I would like m

Problem creating executable, with PyQwt

2010-02-21 Thread Gib Bogle
My student is trying to build an executable version of a program that uses PyQt and PyQwt, on Windows XP. She has installed: Python 2.6.1, Qt 4.5.0, PyQt 4.5, and PyQwt 5.2.0. There is a module error on running the executable produced by py2exe. Here is the info I got from my student:

Re: Saving the Interactive Window with PythonWin

2010-02-21 Thread Mark Hammond
On 22/02/2010 4:28 AM, vsoler wrote: Hi everyone, When I run a python script, I know that I can print the results of my calculations on the Interactive Window. Once the scripts ends, I can copy/pate these results on an OpenOffice Writer document. However, I would like to know if I can somehow a

Re: Use eval() safely?

2010-02-21 Thread Steven D'Aprano
On Sun, 21 Feb 2010 22:25:11 +0100, W. Martin Borgert wrote: > Hi, > > I know that this issue has been discussed before, but most of the time > using only one argument to eval(). > > Is it possible to use the following code, e.g. run as part of a web > application, to break in and if so, how? >

Re: Pure virtual functions in Python?

2010-02-21 Thread Gregory Ewing
lallous wrote: If the base defines the method and it was empty, then my C++ code would still call the function. This is not optimal because I don't want to go from C++ to Python if the _derived_ class does not implement the cb. I would simply not implement the method at all in the base class. T

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Steven D'Aprano
On Sun, 21 Feb 2010 13:40:54 -0800, Mensanator wrote: > Yeah, I saw that. Funny that something important like that wasn't part > of the > announcement. I notice no mention of Mac OS, so visiting the website was > a complete > waste of time on my part, wasn't it? Of course not. Now you know that M

Re: lists of variables

2010-02-21 Thread Gregory Ewing
Steven D'Aprano wrote: On Sat, 20 Feb 2010 22:31:44 -0800, Carl Banks wrote: The one place where Python does have references is when accessing variables in an enclosing scope (not counting module-level). What makes you say that? I think Carl is talking about cells, which *are* actually ob

Re: Efficient way to break up a list into two pieces

2010-02-21 Thread Steven D'Aprano
On Sun, 21 Feb 2010 11:07:24 -0800, marwie wrote: >> x = SomeReallyBigListOrString >> for item in x[1:]: >>     process(item) >> >> has to copy the entire list or string (less the first item). But >> honestly, I've never found a situation where it actually mattered. > > Good grief, it copies that

Re: with statement and standard library

2010-02-21 Thread Chris Rebert
On Sun, Feb 21, 2010 at 3:21 PM, John Nagle wrote: > nobrowser wrote: >> >> Hi.  The with statement is certainly nifty.  The trouble is, the >> *only* two documented examples how it can be used with the library >> classes are file objects (which I use all the time) and thread locks >> which I almo

Re: with statement and standard library

2010-02-21 Thread John Nagle
nobrowser wrote: Hi. The with statement is certainly nifty. The trouble is, the *only* two documented examples how it can be used with the library classes are file objects (which I use all the time) and thread locks which I almost never use. Yet there are many, many classes in the library whos

Re: Overcoming python performance penalty for multicore CPU

2010-02-21 Thread Ryan Kelly
On Sun, 2010-02-21 at 23:05 +0100, Martin v. Loewis wrote: > > It's far from scientific, but I've seen behaviour that's close to a 100% > > performance penalty on a dual-core linux system: > > > >http://www.rfk.id.au/blog/entry/a-gil-adventure-threading2 > > > > Short story: a particular te

Re: Overcoming python performance penalty for multicore CPU

2010-02-21 Thread Martin v. Loewis
> It's far from scientific, but I've seen behaviour that's close to a 100% > performance penalty on a dual-core linux system: > >http://www.rfk.id.au/blog/entry/a-gil-adventure-threading2 > > Short story: a particular test suite of mine used to run in around 25 > seconds, but a bit of ctypes

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread sstein...@gmail.com
On Feb 21, 2010, at 4:40 PM, Mensanator wrote: > On Feb 21, 12:14 pm, Paul Boddie wrote: >> On 21 Feb, 17:32, Mensanator wrote: >> >>> On Feb 21, 10:30 am, Mensanator wrote: >> What versions of Python does it suuport? >> >>> What OS are supported? >> >> From the Web site referenced in

Re: lists of variables

2010-02-21 Thread bartc
"Michael Pardee" wrote in message news:mailman.22.1266722722.4577.python-l...@python.org... I'm relatively new to python and I was very surprised by the following behavior: a=1 b=2 mylist=[a,b] print mylist [1, 2] a=3 print mylist [1, 2] Whoah! Are python lists only for literals? Nope

Use eval() safely?

2010-02-21 Thread W. Martin Borgert
Hi, I know that this issue has been discussed before, but most of the time using only one argument to eval(). Is it possible to use the following code, e.g. run as part of a web application, to break in and if so, how? import math def myeval(untrustedinput): return eval(untrustedinput, {"__

Re: Overcoming python performance penalty for multicore CPU

2010-02-21 Thread Ryan Kelly
On Sun, 2010-02-21 at 22:22 +0100, Martin v. Loewis wrote: > John Nagle wrote: > >I know there's a performance penalty for running Python on a > > multicore CPU, but how bad is it? I've read the key paper > > ("www.dabeaz.com/python/GIL.pdf"), of course. It would be adequate > > if the GIL ju

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Mensanator
On Feb 21, 12:14 pm, Paul Boddie wrote: > On 21 Feb, 17:32, Mensanator wrote: > > > On Feb 21, 10:30 am, Mensanator wrote: > > > > What versions of Python does it suuport? > > > What OS are supported? > > From the Web site referenced in the announcement (http:// > dreampie.sourceforge.net/): > >

Re: Efficient way to break up a list into two pieces

2010-02-21 Thread Steve Howell
On Feb 20, 5:55 pm, marwie wrote: > On 21 Feb., 02:30, Steven D'Aprano > cybersource.com.au> wrote: > > Python lists are arrays of pointers to objects, so copying a slice is > > fast: it doesn't have to copy the objects, just pointers. Deleting from > > the end of the list is also quick, because

Re: Overcoming python performance penalty for multicore CPU

2010-02-21 Thread Martin v. Loewis
John Nagle wrote: >I know there's a performance penalty for running Python on a > multicore CPU, but how bad is it? I've read the key paper > ("www.dabeaz.com/python/GIL.pdf"), of course. It would be adequate > if the GIL just limited Python to running on one CPU at a time, > but it's worse t

Re: How would I do a continuous write over a pipe in the following code...

2010-02-21 Thread Chris Rebert
On Sun, Feb 21, 2010 at 1:09 PM, Dennis Lee Bieber wrote: > On Sat, 20 Feb 2010 12:46:24 -0800 (PST), chad > declaimed the following in comp.lang.python: > >> Given the following >> >> #!/usr/bin/python >> >> import subprocess as s >> >> broadcast = s.Popen("echo test | wall", shell=True,stdo

FOREX : Foreign Exchange Market : FX : Currency Market : Earn Money Quickly.

2010-02-21 Thread MY NAME IS MY NAME
FOREX : Foreign Exchange Market : FX : Currency Market : Earn Money Quickly. Simple Optimized Tips and Tricks, Basics of FOREX to be a king of FOREX in one day. Check out these exclusive never seen tips for free at http://forex-fx-currencymarket.blogspot.com/2010/02/forex-market-size-and-liquidi

Re: Efficient way to break up a list into two pieces

2010-02-21 Thread MRAB
MRAB wrote: Steven D'Aprano wrote: [snip] I'm sympathetic to your concern: I've often felt offended that doing something like this: x = SomeReallyBigListOrString for item in x[1:]: process(item) has to copy the entire list or string (less the first item). But honestly, I've never found a

Re: Efficient way to break up a list into two pieces

2010-02-21 Thread marwie
On 21 Feb., 07:38, Carl Banks wrote: > Numpy arrays can share underlying data like that when you take > slices.  For instance, this probably works the way you want: > > a = numpy.array([1,2,3,4,5,6]) > b = a[:3] > c = a[3:] > > None of the actual data was copied here. Hmm, that might be worth loo

Re: Efficient way to break up a list into two pieces

2010-02-21 Thread marwie
On 21 Feb., 04:40, Steven D'Aprano wrote: > > Additionally, Python lists are over-allocated so that appends are fast. A > list of (say) 1000 items might be over-allocated to (say) 1024 items, so > that you can do 24 appends before the array is full and the array needs > to be resized. This means t

Re: formatting a number as percentage

2010-02-21 Thread Günther Dietrich
vsoler wrote: >I'm trying to print .7 as 70% >I've tried: > >print format(.7,'%%') >.7.format('%%') > >but neither works. I don't know what the syntax is... Did you try this: >>> print('%d%%' % (0.7 * 100)) 70% Best regards, Günther -- http://mail.python.org/mailman/listinfo/python-list

Re: The future of "frozen" types as the number of CPU cores increases

2010-02-21 Thread Paul Boddie
On 21 Feb, 03:00, "sjdevn...@yahoo.com" wrote: > On Feb 18, 2:58 pm, John Nagle wrote: > > >     Multiple processes are not the answer.  That means loading multiple > > copies of the same code into different areas of memory.  The cache > > miss rate goes up accordingly. > > A decent OS will use c

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-21 Thread John Bokma
Jonathan Gardner writes: > On Fri, Feb 19, 2010 at 11:16 PM, Lie Ryan wrote: >> >> Now, why don't we start a PEP to make python a fully-functional language >> then? > > Because people don't think the same way that programs are written in > functional languages. Heh! When I learned Miranda it fe

Re: formatting a number as percentage

2010-02-21 Thread vsoler
On Feb 21, 7:11 pm, TomF wrote: > On 2010-02-21 09:53:45 -0800, vsoler said: > > > I'm trying to print .7 as 70% > > I've tried: > > > print format(.7,'%%') > > .7.format('%%') > > > but neither works. I don't know what the syntax is... > >>> print "Grade is {0:%}".format(.87) > > Grade is 87.000

Re: formatting a number as percentage

2010-02-21 Thread Mark Dickinson
On Feb 21, 5:53 pm, vsoler wrote: > I'm trying to print .7 as 70% > I've tried: > > print format(.7,'%%') > .7.format('%%') > > but neither works. I don't know what the syntax is... Assuming that you're using Python 2.6 (or Python 3.x): >>> format(.7, '%') '70.00%' >>> format(.7, '.2%') '70.

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Paul Boddie
On 21 Feb, 17:32, Mensanator wrote: > On Feb 21, 10:30 am, Mensanator wrote: > > > What versions of Python does it suuport? > > What OS are supported? >From the Web site referenced in the announcement (http:// dreampie.sourceforge.net/): """ # Supports Python 2.5, Python 2.6, Jython 2.5, IronPy

Re: formatting a number as percentage

2010-02-21 Thread TomF
On 2010-02-21 09:53:45 -0800, vsoler said: I'm trying to print .7 as 70% I've tried: print format(.7,'%%') .7.format('%%') but neither works. I don't know what the syntax is... print "Grade is {0:%}".format(.87) Grade is 87.00% or if you want to suppress those trailing zeroes: print

Re: formatting a number as percentage

2010-02-21 Thread Chris Colbert
>>> print('%.0f%%' % (0.7*100)) 70% On Sun, Feb 21, 2010 at 12:53 PM, vsoler wrote: > I'm trying to print .7 as 70% > I've tried: > > print format(.7,'%%') > .7.format('%%') > > but neither works. I don't know what the syntax is... > > Can you help? > > Thank you > -- > http://mail.python.org/ma

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread sstein...@gmail.com
On Feb 21, 2010, at 11:51 AM, Chris Colbert wrote: > http://dreampie.sourceforge.net/download.html > > reading is a wonderful thing. I got it running on OS X with MacPorts after about an hour of installing everything required for gtk and gtksourceview (including a new gcc, apparently). Now...

formatting a number as percentage

2010-02-21 Thread vsoler
I'm trying to print .7 as 70% I've tried: print format(.7,'%%') .7.format('%%') but neither works. I don't know what the syntax is... Can you help? Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: Not sure why this is filling my sys memory

2010-02-21 Thread Vincent Davis
@"sstein...@gmail.com" "See this article for some more info about the reported sizes of things: http://www.doughellmann.com/PyMOTW/sys/limits.html"; I posted this question on stack overflow. I now have a better appreciation of ssteinerX suggestions of the above link and guppy, I also had pympler

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Iuri
I tested it in Windows Vista. When I type single or double quotes, I get a unicode character, different of python's quotes, and it break my code. But i liked this tool! Thanks! []s iuri On Sun, Feb 21, 2010 at 3:13 PM, Chris Colbert wrote: > This is bloody fantastic! I must say, this fixes

Saving the Interactive Window with PythonWin

2010-02-21 Thread vsoler
Hi everyone, When I run a python script, I know that I can print the results of my calculations on the Interactive Window. Once the scripts ends, I can copy/pate these results on an OpenOffice Writer document. However, I would like to know if I can somehow add some lines to my script, so that it

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Chris Colbert
This is bloody fantastic! I must say, this fixes everything I hate about Ipython and gives me the feature I wished it had (with a few minor exceptions). I confirm this working on Kubuntu 9.10 using the ppa listed on the sites download page. I also confirm that it works interactively with PyQt4 an

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Chris Colbert
http://dreampie.sourceforge.net/download.html reading is a wonderful thing. On Sun, Feb 21, 2010 at 11:32 AM, Mensanator wrote: > On Feb 21, 10:30�am, Mensanator wrote: > > On Feb 21, 3:42 am, Noam Yorav-Raphael wrote:> I'm > pleased to announce DreamPie 1.0 - a new graphical interactive > >

Free chat for u.....hot.hot.....hot..............

2010-02-21 Thread sk raj
http://chattingfree.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Mensanator
On Feb 21, 10:30�am, Mensanator wrote: > On Feb 21, 3:42 am, Noam Yorav-Raphael wrote:> I'm > pleased to announce DreamPie 1.0 - a new graphical interactive > > Python shell! > > What versions of Python does it suuport? What OS are supported? -- http://mail.python.org/mailman/listinfo/python-l

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Mensanator
On Feb 21, 3:42�am, Noam Yorav-Raphael wrote: > I'm pleased to announce DreamPie 1.0 - a new graphical interactive > Python shell! > What versions of Python does it suuport? -- http://mail.python.org/mailman/listinfo/python-list

Re: Which mock library do you prefer?

2010-02-21 Thread Lacrima
On Feb 18, 3:20 am, Ben Finney wrote: > Lacrima writes: > > Right, isolation [of test cases] is essential. But I can't decide to > > which extent I should propagate isolation. > > You used “propagate” in a sense I don't understand there. > > > For example, in "Python Testing: Beginner's Guide" by

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Noam Yorav-Raphael
Delete \Documents and Settings\\DreamPie and it should now work. Did you edit the colors using the configuration window or manually? If you edited them using the configuration window, can you give instructions on how to reproduce the bug? Noam On Feb 21, 3:06 pm, "Aage Andersen" wrote: > I reins

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Aage Andersen
I reinstalled and got this message: Traceback (most recent call last): File "dreampie.py", line 4, () File "dreampielib\gui\__init__.pyc", line 972, main() File "dreampielib\gui\__init__.pyc", line 153, __init__(self=DreamPie(path..."window_main"), pyexec='C:\\Python26\\python.exe') File

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Aage Andersen
I tried to edit the awfully colors, here are the results: Traceback (most recent call last): File "dreampie.py", line 4, () File "dreampielib\gui\__init__.pyc", line 972, main() File "dreampielib\gui\__init__.pyc", line 153, __init__(self=DreamPie(path..."window_main"), pyexec='C:\\Python2

Re: lists of variables

2010-02-21 Thread Steven D'Aprano
On Sat, 20 Feb 2010 23:44:29 -0800, Carl Banks wrote: > On Feb 20, 10:50 pm, Steven D'Aprano cybersource.com.au> wrote: >> What makes you say that? [...] >> I don't even understand this. [...] >> I'm just confused why you think that >> lexical scoping is equivalent to references that can't be pu

Re: lists of variables

2010-02-21 Thread Lie Ryan
On 02/21/10 15:21, Steven D'Aprano wrote: >> > So it looks like variables in a list are stored as object references. > Python doesn't store variables in lists, it stores objects, always. > > Even Python variables aren't variables *grin*, although it's really > difficult to avoid using the term. P

Re: Pure virtual functions in Python?

2010-02-21 Thread Lie Ryan
On 02/21/10 19:27, lallous wrote: > If the base defines the method and it was empty, then my C++ code > would still call the function. This is not optimal because I don't > want to go from C++ to Python if the _derived_ class does not > implement the cb. That sounds like a microoptimization; hav

DreamPie - The Python shell you've always dreamed about!

2010-02-21 Thread Noam Yorav-Raphael
I'm pleased to announce DreamPie 1.0 - a new graphical interactive Python shell! Some highlights: * Has whatever you would expect from a graphical Python shell - attribute completion, tooltips which show how to call functions, highlighting of matching parentheses, etc. * Fixes a lot of IDLE nuisa

Re: /usr/bin/ld: cannot find -lz on Cent OS - Python 2.4

2010-02-21 Thread Anssi Saari
V8 NUT writes: > /usr/bin/ld: cannot find -lz > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 Could it be you're missing zlib-devel? What does yum info zlib-devel say? Or locate libz? -- http://mail.python.org/mailman/listinfo/python-list

Re: Pure virtual functions in Python?

2010-02-21 Thread Martin v. Loewis
>> That's not true. Currently, the hasattr() call would report that cb is >> available, when it is actually not implemented. It would be possible to >> do something like >> >> if hasattr(c, 'cb') and not is_pure(c.cb): >> c.cb("Hello", "World") >> >> is_pure could, for example, look at a fu

Re: datelib pythonification

2010-02-21 Thread John Machin
On Feb 21, 12:37 pm, alex goretoy wrote: > hello all, >     since I posted this last time, I've added a new function dates_diff and [SNIP] I'm rather unsure of the context of this posting ... I'm assuming that the subject "datelib pythonification" refers to trying to make "datelib" more "pythoni

Re: Pure virtual functions in Python?

2010-02-21 Thread lallous
Thanks everyone for the answers. The dispatcher() is actually sits in C++ code. So my code receives an object that is an instance of the base class, it PyObject_GetAttrString(py_obj, 'funcname'). If the attribute exists I will call PyObject_CallMethod on it. If the base defines the method and it

Re: Pure virtual functions in Python?

2010-02-21 Thread lallous
On Feb 20, 6:08 pm, "Martin v. Loewis" wrote: > >> class C1: > > >>      # Pure virtual > >>      def cb(self, param1, param2): > >>          """ > >>          This is a callback > > >>         �...@param param1: ... > >>         �...@param param2: ... > >>          """ > >>          raise NotImpl