[issue10968] Timer class inheritance issue

2011-01-21 Thread Benjamin VENELLE
Benjamin VENELLE added the comment: Yes that's it. I Should precise it. I've taken a screenshot from my python's interpreter to spot it. -- Added file: http://bugs.python.org/file20479/issue10968.png ___ Python tracker

[issue10968] Timer class inheritance issue

2011-01-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: It seems to be by design: from the documentation: http://docs.python.org/py3k/library/threading.html "Timer is a subclass of Thread", and a Thread subclass should "only override the __init__() and run() methods". What are you trying to do here? overridin

[issue10968] Timer class inheritance issue

2011-01-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Ah, got it. It's about threading.Timer, which looks like a class, but is actually a function. -- ___ Python tracker ___

[issue10968] Timer class inheritance issue

2011-01-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I can't reproduce the error. Do you have a script that shows the issue? What is the complete traceback? -- nosy: +amaury.forgeotdarc ___ Python tracker _

[issue10968] Timer class inheritance issue

2011-01-21 Thread Benjamin VENELLE
Benjamin VENELLE added the comment: I've tested it with Python 3.1.2 under Windows 7 32 bits. It raises the following TypeError exception "function() argument 1 must be code, not str" -- ___ Python tracker __

[issue10968] Timer class inheritance issue

2011-01-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Works for me: >>> from timeit import Timer >>> class A(Timer): pass ... (Tested with Python 3.1 and 3.2 on OSX.) -- nosy: +belopolsky ___ Python tracker _

[issue10968] Timer class inheritance issue

2011-01-20 Thread Benjamin VENELLE
New submission from Benjamin VENELLE : Hi, Due to Timer's object creation behavior, it is impossible to subclass it. This kind of declaration will result to an exception raising: class A(Timer): pass -- components: +Library (Lib) -Benchmarks versions: +Python 3.1

[issue10968] Timer class inheritance issue

2011-01-20 Thread Benjamin VENELLE
Changes by Benjamin VENELLE : -- assignee: collinwinter components: Benchmarks nosy: Kain94, collinwinter priority: normal severity: normal status: open title: Timer class inheritance issue type: behavior ___ Python tracker