[ANN] Benchmarker 1.0.0 - a samll utility for benchmarking

2010-05-16 Thread kwatch
Hi, I released Benchmarker 1.0.0. http://pypi.python.org/pypi/Benchmarker/ Benchmarker is a small library for benchmarking. Example --- ex.py:: def fib(n): return n = 2 and 1 or fib(n-1) + fib(n-2) from benchmarker import Benchmarker bm = Benchmarker() # or

Re: Reading XML namespaces

2010-05-16 Thread Stefan Behnel
Martin v. Loewis, 15.05.2010 23:37: BTW, I'm still not sure I understand your problem. Could you provide some more details? Wouldn't it be easier if you told the OP how to access the prefix mappings in lxml etree, or, if this was actually not possible, admitted that it is actually not

Re: Reading XML namespaces

2010-05-16 Thread Stefan Behnel
Adam Tauno Williams, 16.05.2010 06:00: Given that XML documents can be very large I'd rather avoid a parsing of the document [beyond what lxml/etree] has already done] just to retrieve the namespaces and their prefixes. In order to find out which prefixes are used in the document and which set

Re: Reading XML namespaces

2010-05-16 Thread Stefan Behnel
Adam Tauno Williams, 15.05.2010 23:04: On Sat, 2010-05-15 at 22:58 +0200, Stefan Behnel wrote: Adam Tauno Williams, 15.05.2010 22:40: On Sat, 2010-05-15 at 22:29 +0200, Stefan Behnel wrote: Adam Tauno Williams, 15.05.2010 20:37: Say I have an XML document that begins with: ?xml version=1.0

joining files

2010-05-16 Thread mannu jha
Hi, I have few files like this: file1: 22 110.1 33 331.5 22.7 5 271.9 17.2 33.4 4 55.1 file1 has total 4 column but some of them are missing in few row. file2: 5 H 22 0 file3: 4 T 5 B 22 C 121 S in all these files first column is the main source of matching their entries. So What I want

Re: Reading XML namespaces

2010-05-16 Thread Martin v. Loewis
Well, there's an nsmap property on each Element that provides the mapping of prefixes to namespace URIs that form the scope of the Element. However, while this is what the OP asked for, it is not what the OP wants, simply because it doesn't solve the problem. Well, it solves the problem at

Re: Reading XML namespaces

2010-05-16 Thread Stefan Behnel
Martin v. Loewis, 16.05.2010 09:07: the approach that the OP is apparently trying to follow is clearly misguided. I completely agree. However, I recommend that we let him find out on his own. I suspect he has some idiomatic usage of XML, perhaps with all namespace prefixes defined in the

Re: parsing XML

2010-05-16 Thread Jake b
Check out Amara: http://www.xml3k.org/Amara/QuickRef It looks promising. For a pythonic solution over sax / dom. Iter(doc.team.player) # or doc.team.player[0].name [ new to the list, so I'm not sure why my previous response failed. Is it on me? Because using iPod, vs thunderbird? However,

Re: joining files

2010-05-16 Thread James Mills
On Sun, May 16, 2010 at 5:02 PM, mannu jha mannu_0...@rediffmail.com wrote: Hi, I have few files like this: file1: 22 110.1 33 331.5 22.7 5 271.9 17.2 33.4 4 55.1 file1 has total 4 column but some of them are missing in few row. file2: 5 H 22 0 file3: 4 T 5 B 22 C 121 S in

[ANN] Oktest 0.3.0 released - a new style testing library

2010-05-16 Thread kwatch
Hi, I released Oktest 0.3.0. http://packages.python.org/Oktest/ http://pypi.python.org/pypi/Oktest/ Overview Oktest is a new-style testing library for Python. :: from oktest import ok ok (x) 0 # same as assert_(x 0) ok (s) == 'foo'# same as

Re: parsing XML

2010-05-16 Thread Stefan Behnel
Jake b, 16.05.2010 09:40: Check out Amara: http://www.xml3k.org/Amara/QuickRef It looks promising. For a pythonic solution over sax / dom. Iter(doc.team.player) # or doc.team.player[0].name Ah, right, and there's also lxml.objectify: from lxml.objectify import parse root =

Re: joining files

2010-05-16 Thread Chris Rebert
On Sun, May 16, 2010 at 12:02 AM, mannu jha mannu_0...@rediffmail.com wrote: Hi, I have few files like this: file1: 22 110.1 33 331.5 22.7 5 271.9 17.2 33.4 4 55.1 file1 has total 4 column but some of them are missing in few row. file2: 5 H 22 0 file3: 4 T 5 B 22 C 121 S in

Re: joining files

2010-05-16 Thread Dave Angel
mannu jha wrote: Hi, I have few files like this: file1: 22 110.1 33 331.5 22.7 5 271.9 17.2 33.4 4 55.1 file1 has total 4 column but some of them are missing in few row. file2: 5 H 22 0 file3: 4 T 5 B 22 C 121 S in all these files first column is the main source of matching their

Re: Setup global variables settings for the entire applications

2010-05-16 Thread Chris Rebert
On Fri, May 14, 2010 at 7:32 AM, AON LAZIO aonla...@gmail.com wrote: Hi,    Say I have an application which requires a global settings for the user. When the user finishes setting those global variables for the app. Any class can use that variables (which are the same for all), something like

Re: Reading XML namespaces

2010-05-16 Thread Martin v. Loewis
Maybe true technically, but false in practice. If I receive XML data from source XYZ or service XYZ the use of namespaces and their prefixes is extremely consistent [in practice] and very customary (for example: I've never seen the DSML namespace abbreviated as anything other than dsml and I

Using site-packages with alt-installed Python version

2010-05-16 Thread Tuomas Vesterinen
I am testing an application GUI with Python 2.4, 2.5 and 2.6. The native Python (in Fedora 12) is 2.6. Versions 2.4 and 2.5 are alt-installed. Aplication GUI uses: import pygtk pygtk.require('2.0') import gtk import gobject I go to: $ cd /usr/local/lib/python2.4/site-packages and say: $ sudo

Re: huh??? weird problem

2010-05-16 Thread Paul Hankin
On May 15, 3:41 am, Dave Angel da...@ieee.org wrote: cerr wrote: Hi There, I got following code: start=time.time() print 'warnTimeout '+str(WarnTimeout) print 'critTimeout '+str(CritTimeout) print 'start',str(start) while wait:     passed =  time.time()-start     print 'passed

Re: Using site-packages with alt-installed Python version

2010-05-16 Thread Alister
On Sun, 16 May 2010 12:07:08 +0300, Tuomas Vesterinen wrote: I am testing an application GUI with Python 2.4, 2.5 and 2.6. The native Python (in Fedora 12) is 2.6. Versions 2.4 and 2.5 are alt-installed. Aplication GUI uses: import pygtk pygtk.require('2.0') import gtk import gobject

Fw: Re: Re: joining files

2010-05-16 Thread mannu jha
Note: Forwarded message attached -- Original Message -- From: mannu jhamannu_0...@rediffmail.com To: da...@ieee.org Subject: Re: Re: joining files---BeginMessage--- On Sun, 16 May 2010 13:52:31 +0530 wrote mannu jha wrote: Hi, I have few files like this: file1: 22 110.1 33 331.5

Re: Picking a license

2010-05-16 Thread Ed Keith
--- On Sat, 5/15/10, Robert Kern robert.k...@gmail.com wrote: From: Robert Kern robert.k...@gmail.com Subject: Re: Picking a license To: python-list@python.org Date: Saturday, May 15, 2010, 1:10 PM On 2010-05-14 21:37 , Steven D'Aprano wrote: On Fri, 14 May 2010 06:42:31 -0700, Ed Keith

Re: joining files

2010-05-16 Thread Dave Angel
(You forgot to include the python-list in your response. So it only went to me. Normally, you just do reply-all to the message) mannu jha wrote: On Sun, 16 May 2010 13:52:31 +0530 wrote mannu jha wrote: Hi, I have few files like this: file1: 22 110.1 33 331.5

Re: Picking a license

2010-05-16 Thread Ed Keith
--- On Sat, 5/15/10, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: From: Lawrence D'Oliveiro l...@geek-central.gen.new_zealand Subject: Re: Picking a license To: python-list@python.org Date: Saturday, May 15, 2010, 11:06 PM In message

Re: joining files

2010-05-16 Thread Aahz
In article mailman.255.1273997908.32709.python-l...@python.org, Chris Rebert c...@rebertia.com wrote: -- insert Indian programmer quality joke here That's not funny. I'm sure I'd have little difficulty finding poor programmers of whatever demographic groups you belong to. Or perhaps you

Re: Access to comp.lang.python

2010-05-16 Thread cjw
On 16-May-10 01:31 AM, James Mills wrote: On Sun, May 16, 2010 at 3:12 PM, Aahza...@pythoncraft.com wrote: It's also at least partly due to problems with mail-news gateways and the differing fields used to maintain threading. Some blame goes on MUAs too :) Thanks for the responses. Is it

Re: Access to comp.lang.python

2010-05-16 Thread Grant Edwards
On 2010-05-16, cjw c...@ncf.ca wrote: On 16-May-10 01:31 AM, James Mills wrote: On Sun, May 16, 2010 at 3:12 PM, Aahza...@pythoncraft.com wrote: It's also at least partly due to problems with mail-news gateways and the differing fields used to maintain threading. Some blame goes on MUAs too

Re: Reading XML namespaces

2010-05-16 Thread Stefan Behnel
Martin v. Loewis, 16.05.2010 11:05: Maybe true technically, but false in practice. If I receive XML data from source XYZ or service XYZ the use of namespaces and their prefixes is extremely consistent [in practice] and very customary (for example: I've never seen the DSML namespace abbreviated

Re: Access to comp.lang.python

2010-05-16 Thread John Bokma
cjw c...@ncf.ca writes: Is it possible to connect a newsreader to gmane? http://johnbokma.com/mexit/2005/01/14/gmane-mail-to-news.html Is Thunderbird known to have problems? It worked good for me, but that was 5+ years ago. (Time flies) -- John Bokma

Re: Access to comp.lang.python

2010-05-16 Thread Jim Byrnes
Grant Edwards wrote: On 2010-05-16, cjwc...@ncf.ca wrote: On 16-May-10 01:31 AM, James Mills wrote: On Sun, May 16, 2010 at 3:12 PM, Aahza...@pythoncraft.com wrote: It's also at least partly due to problems with mail-news gateways and the differing fields used to maintain threading. Some

Object-oriented (was: Is Python a functional programming language?)

2010-05-16 Thread Teemu Likonen
* 2010-05-15 09:42 (-0700), travis wrote: PS: Why do people call LISP object-oriented? Are they smoking crack? No classes, no methods, no member variables... WTF? Maybe because Common Lisp has a strong support for object-oriented programming. Peter Seibel: Practical Common Lisp

Updating values in a dictionary

2010-05-16 Thread Thomas
Greetings I am having a darn awful time trying to update a matrix: row = dict([(x,0) for x in range(3)]) matrix = dict([(x,row) for x in range(-3,4,1)]) matrix[2][1] += 1 matrix[-1][2] += 1 Got: a 1 in all col 1 and 2 {-3: {0: 0, 1: 1, 2: 1}, -2: {0: 0, 1: 1, 2: 1}, -1: {0: 0, 1: 1, 2: 1},

Re: recursively remove all the directories and files which begin with '.'

2010-05-16 Thread Sean DiZazzo
On May 14, 8:27 am, albert kao albertk...@gmail.com wrote: On May 14, 11:01 am, J dreadpiratej...@gmail.com wrote: On Fri, May 14, 2010 at 10:53, albert kao albertk...@gmail.com wrote: C:\pythonrmdir.py C:\test\com.comp.hw.prod.proj.war\bin ['.svn', 'com'] d .svn dotd

Re: Updating values in a dictionary

2010-05-16 Thread Chris Rebert
On Sun, May 16, 2010 at 10:36 AM, Thomas thom1...@gmail.com wrote: Greetings I am having a darn awful time trying to update a matrix: row = dict([(x,0) for x in range(3)]) matrix = dict([(x,row) for x in range(-3,4,1)]) All the columns refer to the very same row dict (`row` obviously).

Global variables for python applications

2010-05-16 Thread AON LAZIO
Hi, How can I set up global variables for the entire python applications? Like I can call and set this variables in any .py files. Think of it as a global variable in a single .py file but this is for the entire application. Thanks -- Aonlazio 'Peace is always the way.' NW --

Re: Updating values in a dictionary

2010-05-16 Thread superpollo
Thomas ha scritto: Greetings I am having a darn awful time trying to update a matrix: row = dict([(x,0) for x in range(3)]) matrix = dict([(x,row) for x in range(-3,4,1)]) matrix[2][1] += 1 matrix[-1][2] += 1 Got: a 1 in all col 1 and 2 {-3: {0: 0, 1: 1, 2: 1}, -2: {0: 0, 1: 1, 2: 1}, -1:

Re: Global variables for python applications

2010-05-16 Thread James Mills
On Mon, May 17, 2010 at 3:50 AM, AON LAZIO aonla...@gmail.com wrote: Hi,    How can I set up global variables for the entire python applications? Like I can call and set this variables in any .py files.    Think of it as a global variable in a single .py file but this is for the entire

Re: recursively remove all the directories and files which begin with '.'

2010-05-16 Thread Irmen de Jong
On 16-5-2010 19:41, Sean DiZazzo wrote: On May 14, 8:27 am, albert kaoalbertk...@gmail.com wrote: On May 14, 11:01 am, Jdreadpiratej...@gmail.com wrote: On Fri, May 14, 2010 at 10:53, albert kaoalbertk...@gmail.com wrote: C:\pythonrmdir.py C:\test\com.comp.hw.prod.proj.war\bin

Re: Global variables for python applications

2010-05-16 Thread Krister Svanlund
On Sun, May 16, 2010 at 7:50 PM, AON LAZIO aonla...@gmail.com wrote: Hi,    How can I set up global variables for the entire python applications? Like I can call and set this variables in any .py files.    Think of it as a global variable in a single .py file but this is for the entire

Re: Global variables for python applications

2010-05-16 Thread Chris Rebert
On Sun, May 16, 2010 at 10:50 AM, AON LAZIO aonla...@gmail.com wrote: Hi,    How can I set up global variables for the entire python applications? Like I can call and set this variables in any .py files.    Think of it as a global variable in a single .py file but this is for the entire

Re: Updating values in a dictionary

2010-05-16 Thread Peter Otten
Chris Rebert wrote: Nested comprehensions may be hard to understand, so you may wish to write it using a function instead: def make_row(): return dict([(x,0) for x in range(3)]) matrix = dict([(x,make_row()) for x in range(-3,4,1)]) Another way to skin the cat: row =

Re: joining files

2010-05-16 Thread Tuomas Vesterinen
On 05/16/2010 05:04 PM, Dave Angel wrote: (You forgot to include the python-list in your response. So it only went to me. Normally, you just do reply-all to the message) mannu jha wrote: On Sun, 16 May 2010 13:52:31 +0530 wrote mannu jha wrote: Hi, I have few files like this: file1:

Re: Global variables for python applications

2010-05-16 Thread James Mills
On Mon, May 17, 2010 at 4:00 AM, Krister Svanlund krister.svanl...@gmail.com wrote: On Sun, May 16, 2010 at 7:50 PM, AON LAZIO aonla...@gmail.com wrote:    How can I set up global variables for the entire python applications? Like I can call and set this variables in any .py files.    Think of

Qt and progressBar - how to update

2010-05-16 Thread OMS
I am quite new to Python and Qt and need very urgently advice on how to update Qt progressBar while executing a process. I have went thrugh number of 'google' stuff and saw different solution, hence none worked for me. The best idea I have seen is the usage of QThread and emiting signal from

Re: Using site-packages with alt-installed Python version

2010-05-16 Thread Tuomas Vesterinen
On 05/16/2010 02:38 PM, Alister wrote: On Sun, 16 May 2010 12:07:08 +0300, Tuomas Vesterinen wrote: I am testing an application GUI with Python 2.4, 2.5 and 2.6. The native Python (in Fedora 12) is 2.6. Versions 2.4 and 2.5 are alt-installed. Aplication GUI uses: import pygtk

Re: recursively remove all the directories and files which begin with '.'

2010-05-16 Thread Walter Wefft
Irmen de Jong wrote: On 16-5-2010 19:41, Sean DiZazzo wrote: On May 14, 8:27 am, albert kaoalbertk...@gmail.com wrote: On May 14, 11:01 am, Jdreadpiratej...@gmail.com wrote: On Fri, May 14, 2010 at 10:53, albert kaoalbertk...@gmail.com wrote: C:\pythonrmdir.py

Re: Updating values in a dictionary

2010-05-16 Thread Thomas
Chris Wow, that was a very fast response. Thank you, it works (of course)... Cheers Chris Rebert c...@rebertia.com wrote in message news:mailman.264.1274032106.32709.python-l...@python.org... On Sun, May 16, 2010 at 10:36 AM, Thomas thom1...@gmail.com wrote: Greetings I am having a darn

Re: Qt and progressBar - how to update

2010-05-16 Thread Robert Kern
On 2010-05-16 13:28 , OMS wrote: I am quite new to Python and Qt and need very urgently advice on how to update Qt progressBar while executing a process. I have went thrugh number of 'google' stuff and saw different solution, hence none worked for me. The best idea I have seen is the usage of

imports and exec

2010-05-16 Thread Paul Carter
We are using python for our build system. Each subproject dir has a python script that builds it. Parent dirs have python scripts that recurse into their children and use exec to invoke the python scripts. Recently we discovered that one of the python scripts works when invoked directly, but fails

Re: Access to comp.lang.python

2010-05-16 Thread Robert Kern
On 2010-05-16 11:47 , Jim Byrnes wrote: Grant Edwards wrote: On 2010-05-16, cjwc...@ncf.ca wrote: On 16-May-10 01:31 AM, James Mills wrote: On Sun, May 16, 2010 at 3:12 PM, Aahza...@pythoncraft.com wrote: It's also at least partly due to problems with mail-news gateways and the differing

Re: Human word reader

2010-05-16 Thread CM
I need help with getting the useful information how do I get the place if I don't now how long the string is?         And is it supposed to handle         for london give the weather to me         for the london weather give me ...         Do a search on natural language processing...

Re: Human word reader

2010-05-16 Thread CM
On May 16, 2:57 pm, CM cmpyt...@gmail.com wrote: I need help with getting the useful information how do I get the place if I don't now how long the string is?         And is it supposed to handle         for london give the weather to me         for the london weather give me ...

Re: Access to comp.lang.python

2010-05-16 Thread Terry Reedy
On 5/16/2010 11:35 AM, Grant Edwards wrote: On 2010-05-16, cjwc...@ncf.ca wrote: On 16-May-10 01:31 AM, James Mills wrote: On Sun, May 16, 2010 at 3:12 PM, Aahza...@pythoncraft.com wrote: It's also at least partly due to problems with mail-news gateways and the differing fields used to

Re: Updating values in a dictionary

2010-05-16 Thread Terry Reedy
On 5/16/2010 1:36 PM, Thomas wrote: Greetings I am having a darn awful time trying to update a matrix: row = dict([(x,0) for x in range(3)]) matrix = dict([(x,row) for x in range(-3,4,1)]) matrix[2][1] += 1 matrix[-1][2] += 1 Dicts are fine for sparse matrixes, but when filled in, a list of

Re: Global variables for python applications

2010-05-16 Thread christian schulze
On 16 Mai, 20:20, James Mills prolo...@shortcircuit.net.au wrote: On Mon, May 17, 2010 at 4:00 AM, Krister Svanlund krister.svanl...@gmail.com wrote: On Sun, May 16, 2010 at 7:50 PM, AON LAZIO aonla...@gmail.com wrote:    How can I set up global variables for the entire python applications?

Re: Picking a license

2010-05-16 Thread Patrick Maupin
On May 16, 9:19 am, Ed Keith e_...@yahoo.com wrote: --- On Sat, 5/15/10, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: But what about the “freedom” to take away other people’s freedom? Is that really “freedom”? Yes. But that’s a “freedom” that non-GPL licences do

Re: Qt and progressBar - how to update

2010-05-16 Thread OMS
On 16 Maj, 20:52, Robert Kern robert.k...@gmail.com wrote: On 2010-05-16 13:28 , OMS wrote: I am quite new to Python and Qt and need very urgently advice on how to update Qt progressBar while executing a process. I have went thrugh number of 'google' stuff and saw different solution,

Re: Access to comp.lang.python

2010-05-16 Thread Vincent Davis
I have no problem with threads Using gmail in a browser. That said I like how google groups handles email. I am also ways having to fix the reply on this list to send back to the list and not to the list and the last author. If someone knows a way to fix that I would be happy to hear it. Vincent

Re: imports and exec

2010-05-16 Thread Patrick Maupin
On May 16, 1:51 pm, Paul Carter pacman...@gmail.com wrote: We are using python for our build system. Each subproject dir has a python script that builds it. Parent dirs have python scripts that recurse into their children and use exec to invoke the python scripts. Recently we discovered that

global variables in imported modules

2010-05-16 Thread vsoler
Taken from www.python.org, FAQ 2.3 How do I share global variables across modules? config.py: x = 0 # Default value of the 'x' configuration setting mod.py: import config config.x = 1 main.py: import config # try removing it import mod print config.x The example, such as shown in

Re: global variables in imported modules

2010-05-16 Thread Patrick Maupin
On May 16, 4:42 pm, vsoler vicente.so...@gmail.com wrote: Taken fromwww.python.org, FAQ 2.3 How do I share global variables across modules? config.py: x = 0   # Default value of the 'x' configuration setting mod.py: import config config.x = 1 main.py: import config       # try

Re: global variables in imported modules

2010-05-16 Thread Rhodri James
On Sun, 16 May 2010 22:42:40 +0100, vsoler vicente.so...@gmail.com wrote: Taken from www.python.org, FAQ 2.3 How do I share global variables across modules? config.py: x = 0 # Default value of the 'x' configuration setting mod.py: import config config.x = 1 main.py: import config

Re: global variables in imported modules

2010-05-16 Thread vsoler
On 17 mayo, 00:05, Patrick Maupin pmau...@gmail.com wrote: On May 16, 4:42 pm, vsoler vicente.so...@gmail.com wrote: Taken fromwww.python.org, FAQ 2.3 How do I share global variables across modules? config.py: x = 0   # Default value of the 'x' configuration setting mod.py:

Re: global variables in imported modules

2010-05-16 Thread James Mills
On Mon, May 17, 2010 at 8:26 AM, vsoler vicente.so...@gmail.com wrote: However, can I be 100% sure that,no matter how I access variable 'x' (with config.x or mod.config.x) it is always the same 'x'. I mean that either reference of 'x' points to the same id(memory position)? Yes it does unless

Re: global variables in imported modules

2010-05-16 Thread vsoler
On 17 mayo, 00:38, James Mills prolo...@shortcircuit.net.au wrote: On Mon, May 17, 2010 at 8:26 AM, vsoler vicente.so...@gmail.com wrote: However, can I be 100% sure that,no matter how I access variable 'x' (with config.x or mod.config.x) it is always the same 'x'. I mean that either

Re: global variables in imported modules

2010-05-16 Thread Patrick Maupin
On May 16, 5:38 pm, James Mills prolo...@shortcircuit.net.au wrote: On Mon, May 17, 2010 at 8:26 AM, vsoler vicente.so...@gmail.com wrote: However, can I be 100% sure that,no matter how I access variable 'x' (with config.x or mod.config.x) it is always the same 'x'. I mean that either

A couple questions about classes and inheritance

2010-05-16 Thread Paul LaFollette
Kind people, Using Python 3.1 I have been poking around trying to get more insight into Python's innards, and I have a couple of (marginally) related questions. First, I've looked a fair bit and can't find how one can find the base classes of a subclass? isinstance and issubclass sort of do the

Re: A couple questions about classes and inheritance

2010-05-16 Thread Christian Heimes
First, I've looked a fair bit and can't find how one can find the base classes of a subclass? isinstance and issubclass sort of do the opposite of what I want. Surely somewhere there is something like MyThingee.something.orOther.baseClasses() You can get the direct parents of a class with

Re: global variables in imported modules

2010-05-16 Thread vsoler
On 17 mayo, 00:52, Patrick Maupin pmau...@gmail.com wrote: On May 16, 5:38 pm, James Mills prolo...@shortcircuit.net.au wrote: On Mon, May 17, 2010 at 8:26 AM, vsoler vicente.so...@gmail.com wrote: However, can I be 100% sure that,no matter how I access variable 'x' (with config.x or

Re: A couple questions about classes and inheritance

2010-05-16 Thread Steven D'Aprano
On Sun, 16 May 2010 18:58:45 -0400, Paul LaFollette wrote: First, I've looked a fair bit and can't find how one can find the base classes of a subclass? subclass.__base__ subclass.__bases__ subclass.__mro__ (The third one stands for Method Resolution Order.) See also the inspect module.

Re: A couple questions about classes and inheritance

2010-05-16 Thread Carl Banks
On May 16, 4:17 pm, Christian Heimes li...@cheimes.de wrote: First, I've looked a fair bit and can't find how one can find the base classes of a subclass?  isinstance and issubclass sort of do the opposite of what I want.  Surely somewhere there is something like

Re: A couple questions about classes and inheritance

2010-05-16 Thread Terry Reedy
On 5/16/2010 6:58 PM, Paul LaFollette wrote: Anyway, again can you point me to somewhere that I can learn more? In particular, is there a list somewhere of the builtin types that are not subclassable? I believe that in 3.1, the builtin classes with builtin names can be subclassed and and

Re: Global variables for python applications

2010-05-16 Thread John Nagle
James Mills wrote: The only place global variables are considered somewhat acceptable are as constants in a module shared as a static value. Python really ought to have named constants. For one thing, it's fine to share constants across threads, while sharing globals is generally

tone generation for motherboard and sound card speakers?

2010-05-16 Thread Alex Hall
Hi all, I am wondering if there is a way to generate a tone for the motherboard speaker, like the call to Beep() in C++? Also, is there a module to generate tones in Python using the sound card? A module that can beep at a given frequency for a given time using the usual sine wave is okay, but

Re: A couple questions about classes and inheritance

2010-05-16 Thread Mark Young
You can't subclass Ellipsis. -- http://mail.python.org/mailman/listinfo/python-list

Re: Global variables for python applications

2010-05-16 Thread James Mills
On Mon, May 17, 2010 at 11:57 AM, John Nagle na...@animats.com wrote:   For one thing, it's fine to share constants across threads, while sharing globals is generally undesirable.  Also, more compile-time arithmetic becomes possible.   Python does have a few built-in named unassignable

Re: Global variables for python applications

2010-05-16 Thread Steven D'Aprano
On Mon, 17 May 2010 13:34:57 +1000, James Mills wrote: On Mon, May 17, 2010 at 11:57 AM, John Nagle na...@animats.com wrote:   For one thing, it's fine to share constants across threads, while sharing globals is generally undesirable.  Also, more compile-time arithmetic becomes possible.  

Re: Picking a license

2010-05-16 Thread Aahz
In article 87r5ldbw3k@benfinney.id.au, Ben Finney ben+pyt...@benfinney.id.au wrote: a...@pythoncraft.com (Aahz) writes: You can't really sell Open Source software in any practical way; someone will always undercut you once it's out in the wild. You can only sell support for the software,

Re: Global variables for python applications

2010-05-16 Thread Steven D'Aprano
On Sun, 16 May 2010 18:57:15 -0700, John Nagle wrote: James Mills wrote: The only place global variables are considered somewhat acceptable are as constants in a module shared as a static value. Python really ought to have named constants. +1 Unfortunately, it will most likely require

Re: tone generation for motherboard and sound card speakers?

2010-05-16 Thread Jake b
For sound ( not internal beep ) you can check out: - pygame: http://www.pygame.org/project-PygSoundTestTest-1453-.html - python.org/sound : http://wiki.python.org/moin/PythonInMusic - pk http://trac2.assembla.com/pkaudio/ - pureData http://puredata.info/Members/thomas/py -- Jake

Re: Global variables for python applications

2010-05-16 Thread James Mills
On Mon, May 17, 2010 at 2:24 PM, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: In what way are they constant? Can you not modify them and rebind them? It's just style/convention :) Much like _ to denote private variables and methods! --james --

Re: an element from a set

2010-05-16 Thread Carl Banks
On May 14, 11:52 pm, Chris Rebert c...@rebertia.com wrote: On Fri, May 14, 2010 at 11:23 PM, Carl Banks pavlovevide...@gmail.com wrote: On May 14, 9:39 am, Terry Reedy tjre...@udel.edu wrote: On 5/14/2010 11:24 AM, gerardob wrote: Hello, let S be a python set which is not empty

[issue8721] urlparse.urlsplit regression in 2.7

2010-05-16 Thread Senthil Kumaran
Senthil Kumaran orsent...@gmail.com added the comment: FWIW, it should also be noted that RFC asserts square brackets to be valid characters in the hostname portion only and that too when it is a IPv6 url. In the example given, at the query portion, it should be quoted (or percent-encoded)

[issue8633] tarfile doesn't support undecodable filename in PAX format

2010-05-16 Thread Lars Gustäbel
Changes by Lars Gustäbel l...@gustaebel.de: -- assignee: - lars.gustaebel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8633 ___ ___

[issue8692] Use divide-and-conquer for faster factorials

2010-05-16 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Committed in r81196. Thanks, everyone! -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8692 ___

[issue8716] test_tk fails on OS X if run from buildbot slave daemon -- crashes Python

2010-05-16 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: I've filed an issue for this in the Tcl/Tk tracker: https://sourceforge.net/tracker/?func=detailaid=3002320group_id=10894atid=110894 (Assuming that this is the canonical tracker for the Tcl/Tk project, it was the first hit in google

[issue8716] test_tk fails on OS X if run from buildbot slave daemon -- crashes Python

2010-05-16 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: BTW. Another way of testing, assuming you have two accounts: use 'su - otheraccount' to get a shell session as another user then try to start tk using: import Tkinter root = Tkinter.Tk() This will currently crash the interpreter due to

[issue8716] test_tk fails on OS X if run from buildbot slave daemon -- crashes Python

2010-05-16 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: The attached patch is a first start at working around the crash. With this patch I can use Tk without a crash: import Tkinter Tkinter.Tk() Sun May 16 12:11:08 Rivendell.local python.exe[55984] Error: kCGErrorFailure: Set a breakpoint

[issue8716] test_tk fails on OS X if run from buildbot slave daemon -- crashes Python

2010-05-16 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: Something I forgot to mention: the patch introduces _tkinter.m to enable compiling the _tkinter extension as Objective-C code. The compiler also supports passing -x objective-c to compile _tkinter.c in Objective-C mode, but this flag

[issue5766] Mac/scripts/BuildApplet.py reset of sys.executable during install can cause it to use wrong modules

2010-05-16 Thread Ronald Oussoren
Changes by Ronald Oussoren ronaldousso...@mac.com: -- assignee: - ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5766 ___ ___

[issue8688] distutils sdist is too laze w.r.t. recalculating MANIFEST

2010-05-16 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: One way to fix this: is to always recreate MANIFEST when an explicit MANIFEST.in file exists, as in the attached patch. (The patch is not perfect: I'd rename template_newer before committing) -- keywords: +needs review, patch

[issue8550] Expose SSL contexts

2010-05-16 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Since SSLv2 is insecure, could you at least add a warning for that protocol? I think there was a separate issue for removing it altogether, but could a warning be added here? I think it should be a separate issue (since it also applies to the

[issue8688] distutils sdist is too laze w.r.t. recalculating MANIFEST

2010-05-16 Thread Tarek Ziadé
Tarek Ziadé ziade.ta...@gmail.com added the comment: The same problem occurs without a manifest template: you can have options or imports in setup.py that will change the MANIFEST file. For example : if setup() has: packages=['foo'] And if you add a subpackage bar in foo with some

[issue8688] distutils sdist is too laze w.r.t. recalculating MANIFEST

2010-05-16 Thread Tarek Ziadé
Changes by Tarek Ziadé ziade.ta...@gmail.com: -- priority: normal - high ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8688 ___ ___

[issue3754] cross-compilation support for python build

2010-05-16 Thread Roumen Petrov
://bugs.python.org/file17361/python-trunk-20100516-CROSS.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3754 ___ ___ Python-bugs-list mailing list

[issue3871] cross and native build of python for mingw32 with distutils

2010-05-16 Thread Roumen Petrov
Roumen Petrov bugtr...@roumenpetrov.info added the comment: Common to all platforms part of patches lets call it build modules with system python is moved to issue 3754. -- Added file: http://bugs.python.org/file17362/python-trunk-20100516-MINGW.patch

[issue3754] cross-compilation support for python build

2010-05-16 Thread Roumen Petrov
Changes by Roumen Petrov bugtr...@roumenpetrov.info: Removed file: http://bugs.python.org/file14539/python-trunk-20090722-CROSS.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3754 ___

[issue3754] cross-compilation support for python build

2010-05-16 Thread Roumen Petrov
Changes by Roumen Petrov bugtr...@roumenpetrov.info: Removed file: http://bugs.python.org/file15260/python-trunk-20091104-CROSS.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3754 ___

[issue3754] cross-compilation support for python build

2010-05-16 Thread Roumen Petrov
Changes by Roumen Petrov bugtr...@roumenpetrov.info: Removed file: http://bugs.python.org/file15415/python-trunk-20091129-CROSS.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3754 ___

[issue3754] cross-compilation support for python build

2010-05-16 Thread Roumen Petrov
Changes by Roumen Petrov bugtr...@roumenpetrov.info: Removed file: http://bugs.python.org/file15464/python-trunk-20091206-CROSS.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3754 ___

[issue3754] cross-compilation support for python build

2010-05-16 Thread Roumen Petrov
Changes by Roumen Petrov bugtr...@roumenpetrov.info: Removed file: http://bugs.python.org/file15724/python-trunk-20100103-CROSS.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3754 ___

[issue3754] cross-compilation support for python build

2010-05-16 Thread Roumen Petrov
Changes by Roumen Petrov bugtr...@roumenpetrov.info: Removed file: http://bugs.python.org/file15987/python-trunk-20100124-CROSS.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3754 ___

  1   2   >