Re: What do you call a class not intended to be instantiated

2008-09-26 Thread Steven D'Aprano
On Fri, 26 Sep 2008 22:15:43 -0700, Aahz wrote: > In article <[EMAIL PROTECTED]>, > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >>On Thu, 25 Sep 2008 21:17:14 -0700, Aahz wrote: >>> >>> Seems to me that if all the module is used for is to store state, >>> you're wasting a file on disk. I personal

Re: How to get the filename in the right case ?

2008-09-26 Thread r0g
Steven D'Aprano wrote: > On Fri, 26 Sep 2008 01:46:15 +0200, Stef Mientki wrote: > >> Secondly thoughtless copying of current behavior, doesn't bring any >> progress, >> and I think that's one of the reasons why we're still burdened by >> inventions done 20 years ago, >> e.g. "do you want to save

Re: Eggs, VirtualEnv, and Apt - best practices?

2008-09-26 Thread r0g
Diez B. Roggisch wrote: >> that is a very valid point, but it seemed that Scott has homogeneous >> environment: Debian/Ubuntu so my post was relative to the original >> request. >> I agree that when you throw Windows/MacOS into the mix things >> become "interesting". But then it's better when your

Re: what does ` ` do in ' '.join([`x * x` for x in range(1, 6)])?

2008-09-26 Thread r0g
process wrote: > ' '.join([`x * x` for x in range(1, 6)]) > > exactly what does this symbol do and what does it stand for? Ah, just spotted the backticks - they just return whatever's inside them as a string. -- http://mail.python.org/mailman/listinfo/python-list

Re: what does ` ` do in ' '.join([`x * x` for x in range(1, 6)])?

2008-09-26 Thread r0g
process wrote: > ' '.join([`x * x` for x in range(1, 6)]) > > exactly what does this symbol do and what does it stand for? Which symbol, the '*' ??? Are you kidding? -- http://mail.python.org/mailman/listinfo/python-list

Re: Spring Python 0.7.0 is released

2008-09-26 Thread Tim Roberts
Goldfish <[EMAIL PROTECTED]> wrote: > >Release 0.7.0 was completed last night, and released to >sourceforge.net. > >NOTE: This release included a lot of API scrubbing, in order to bring >things more in tune with PEP-0008 (python's style guide). You're >existing apps PROBABLY were impacted, if you u

Re: is decorator the right thing to use?

2008-09-26 Thread Dmitry S. Makovey
George Sakkis wrote: > You seem to enjoy pulling the rug from under our feet by changing the > requirements all the time :) but that's half the fun! ;) Bit more seriously - I didn't know I had those requirements until now :) I'm kind of exploring where can I get with those ideas. Initial post was

Re: What do you call a class not intended to be instantiated

2008-09-26 Thread Aahz
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Thu, 25 Sep 2008 21:17:14 -0700, Aahz wrote: >> >> Seems to me that if all the module is used for is to store state, you're >> wasting a file on disk. I personally prefer to use a class singleton. > >I don't recognise

Re: Time.sleep(0.0125) not available within Linux

2008-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Grant Edwards wrote: > On 2008-09-26, Lawrence D'Oliveiro <[EMAIL PROTECTED]> > wrote: >> In message <[EMAIL PROTECTED]>, Grant Edwards >> wrote: >> >>> Never assume somebody reading the article and attempting to >>> help you can see the subject line. >> >> Why not?

Re: Comparing float and decimal

2008-09-26 Thread Tim Roberts
Mark Dickinson <[EMAIL PROTECTED]> wrote: >On Sep 25, 8:55 am, Tim Roberts <[EMAIL PROTECTED]> wrote: >> Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> >0.1 actually is >> >> >In [98]: '%.50f' % 0.1 >> >Out[98]: '0.1555111512312578270211815834045410' >> >? >> >>  0.1 i

Re: Comparing float and decimal

2008-09-26 Thread Tim Roberts
Mark Dickinson <[EMAIL PROTECTED]> wrote: >On Sep 25, 8:55 am, Tim Roberts <[EMAIL PROTECTED]> wrote: >> Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> >0.1 actually is >> >> >In [98]: '%.50f' % 0.1 >> >Out[98]: '0.1555111512312578270211815834045410' >> >? >> >> Actually, i

Re: multiprocessing eats memory

2008-09-26 Thread Istvan Albert
On Sep 26, 4:52 am, redbaron <[EMAIL PROTECTED]> wrote: > How could I avoid of storing them? I need something to check does it > ready or not and retrieve results if ready. I couldn't see the way to > achieve same result without storing asyncs set. It all depends on what you are trying to do. The

Re: Why are "broken iterators" broken?

2008-09-26 Thread greg
Craig Allen wrote: In the end I interpreted that statement as if "unless __iter__()" is called again It seems you were confusing iterators and iterables. The iterator is the object that is returned by calling __iter__() on an iterable, and yes, you are expected to get a new one each time you w

Re: what does ` ` do in ' '.join([`x * x` for x in range(1, 6)])?

2008-09-26 Thread alex23
On Sep 27, 12:39 pm, process <[EMAIL PROTECTED]> wrote: > ' '.join([`x * x` for x in range(1, 6)]) > > exactly what does this symbol do and what does it stand for? `` is the same as repr(). I'm pretty sure the backtick operator has been removed from 3.0. In the context of the code sample you post

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 9:33 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > George Sakkis <[EMAIL PROTECTED]> writes: > > On Sep 26, 9:30 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > > > I read the group via NNTP, and I find that blocking all articles > > > posted from google.groups gets rid of all of the spam.

Re: Python style: exceptions vs. sys.exit()

2008-09-26 Thread Ross Ridge
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Also note that there are quite a couples cases where the library authors > themselves cannot predict which exception types may be raised - as soon > as the library functions expect callback functions, file-like or > dict-like or whatever-like obj

Build-in 'repr' function (was: what does ` ` do in ' '.join([`x * x` for x in range(1, 6)])?)

2008-09-26 Thread Ben Finney
process <[EMAIL PROTECTED]> writes: > ' '.join([`x * x` for x in range(1, 6)]) > > exactly what does this symbol do and what does it stand for? It's an obsolete, deprecated syntactic sugar for (what is now implemented as) the built-in 'repr' function. Instead, write the above as: ' '.join(

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Grant Edwards
On 2008-09-27, George Sakkis <[EMAIL PROTECTED]> wrote: > On Sep 26, 9:30 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > >> On 2008-09-26, nntpman68 <[EMAIL PROTECTED]> wrote: >> >> > Hm, >> >> > I guess you just filter mailing lists and can do nothing about the >> > newsgroup if I'm fetching via t

what does ` ` do in ' '.join([`x * x` for x in range(1, 6)])?

2008-09-26 Thread process
' '.join([`x * x` for x in range(1, 6)]) exactly what does this symbol do and what does it stand for? -- http://mail.python.org/mailman/listinfo/python-list

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Ben Finney
George Sakkis <[EMAIL PROTECTED]> writes: > On Sep 26, 9:30 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > > I read the group via NNTP, and I find that blocking all articles > > posted from google.groups gets rid of all of the spam. > > ... along with a far from trivial (I guess) percentage of no

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread skip
>> > I read the group via NNTP, and I find that blocking all articles >> > posted from google.groups gets rid of all of the spam. >> >> ... along with a far from trivial (I guess) percentage of non-spam, >> such as this post. Aaron> Every method has false positives, Georg

Re: getting global variables from dictionary

2008-09-26 Thread George Sakkis
On Sep 26, 10:01 pm, icarus <[EMAIL PROTECTED]> wrote: > global_vars.py has the global variables > set_var.py changes one of the values on the global variables (don't > close it or terminate) > get_var.py retrieves the recently value changed (triggered right after > set_var.py above) > > Problem: g

Re: getting global variables from dictionary

2008-09-26 Thread Ben Finney
icarus <[EMAIL PROTECTED]> writes: > global_vars.py has the global variables > set_var.py changes one of the values on the global variables (don't > close it or terminate) > get_var.py retrieves the recently value changed (triggered right after > set_var.py above) > > Problem: get_var.py retrieve

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 9:09 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Sep 26, 9:30 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > > > On 2008-09-26, nntpman68 <[EMAIL PROTECTED]> wrote: > > > > Hm, > > > > I guess you just filter mailing lists and can do nothing about the > > > newsgroup if I'm fetchin

Re: getting global variables from dictionary

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 9:01 pm, icarus <[EMAIL PROTECTED]> wrote: > global_vars.py has the global variables > set_var.py changes one of the values on the global variables (don't > close it or terminate) > get_var.py retrieves the recently value changed (triggered right after > set_var.py above) > > Problem: ge

Re: getting global variables from dictionary

2008-09-26 Thread Chris Rebert
When you do "Variables()" in your code, you're making a new instance of that class that has no relation to any other instances. This is the cause of your problem. To just reference a class, use just "Variables". But that doesn't help in this case because var_dict is an instance variable, not a clas

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread George Sakkis
On Sep 26, 9:30 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-09-26, nntpman68 <[EMAIL PROTECTED]> wrote: > > > Hm, > > > I guess you just filter mailing lists and can do nothing about the > > newsgroup if I'm fetching via the nntp server of my ISP itself, right? > > I read the group via

getting global variables from dictionary

2008-09-26 Thread icarus
global_vars.py has the global variables set_var.py changes one of the values on the global variables (don't close it or terminate) get_var.py retrieves the recently value changed (triggered right after set_var.py above) Problem: get_var.py retrieves the old value, the built-in one but not the rece

Re: Not fully OO ?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 8:10 pm, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > 2008/9/27 Aaron Castironpi Brady <[EMAIL PROTECTED]>: > > > But I, and I imagine I'm not the only one, would love to know the > > example that C# developed faster than Python.  I suppose the fact that > > the line of wx specification that

Re: is decorator the right thing to use?

2008-09-26 Thread George Sakkis
On Sep 26, 6:38 pm, "Dmitry S. Makovey" <[EMAIL PROTECTED]> wrote: > I actually ended up rewriting things (loosely based on George's suggested > code) with descriptors and not using metaclasses or decorators (so much for > my desire to use them). > > With following implementation (unpolished at th

Re: Time.sleep(0.0125) not available within Linux

2008-09-26 Thread Grant Edwards
On 2008-09-26, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In message <[EMAIL PROTECTED]>, Grant Edwards > wrote: > >> Never assume somebody reading the article and attempting to >> help you can see the subject line. > > Why not? Because it might not be. It depends on the user's newsreader a

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Grant Edwards
On 2008-09-26, nntpman68 <[EMAIL PROTECTED]> wrote: > Hm, > > > I guess you just filter mailing lists and can do nothing about the > newsgroup if I'm fetching via the nntp server of my ISP itself, right? I read the group via NNTP, and I find that blocking all articles posted from google.groups ge

Re: Not fully OO ?

2008-09-26 Thread Tim Rowe
2008/9/27 Aaron Castironpi Brady <[EMAIL PROTECTED]>: > But I, and I imagine I'm not the only one, would love to know the > example that C# developed faster than Python. I suppose the fact that > the line of wx specification that has two identifiers where C# has one > is more of a drain on progra

Re: lxml question

2008-09-26 Thread alex23
On Sep 27, 1:19 am, Uwe Schmitt <[EMAIL PROTECTED]> wrote: > I have to parse some text which pretends to be XML. lxml does not want > to parse it, because it lacks a root element. Another option is BeautifulSoup, which handles badly formed XML really well: http://www.crummy.com/software/Beautiful

Re: Large Data Sets: Use base variables or classes? And some binding questions

2008-09-26 Thread Carl Banks
On Sep 26, 8:53 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > It might still end up being slower (creating slot descriptors might > take more time for all I know) but it's more than just an effect of > less memory. Actually scratch that. Descriptors are only created when the type object is created.

Re: Large Data Sets: Use base variables or classes? And some binding questions

2008-09-26 Thread Carl Banks
On Sep 26, 7:43 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 26 Sep 2008 14:54:36 -0700, Carl Banks wrote: > > However, it seems from the rest of your comments that speed is your main > > concern.  Last time someone reported __slots__ didn't make a big > > difference

PyCon 2009 Call for Proposals

2008-09-26 Thread Aahz
Call for proposals -- PyCon 2009 -- === Want to share your experience and expertise? PyCon 2009 is looking for proposals to fill the formal presentation tracks. The PyCon conference days will be March 27-29, 20

Re: Not fully OO ?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 6:40 pm, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > 2008/9/26 Aaron Castironpi Brady <[EMAIL PROTECTED]>: > > > If you have wxFormBuilder and the win32 library, it's pretty fast. > > Speed has never been an issue for me with Python. For my masters > degree I did a project that involved a lo

Re: Not fully OO ?

2008-09-26 Thread Tim Rowe
2008/9/26 Aaron Castironpi Brady <[EMAIL PROTECTED]>: > If you have wxFormBuilder and the win32 library, it's pretty fast. Speed has never been an issue for me with Python. For my masters degree I did a project that involved a lot of number crunching, and in my proposal I wrote that I'd use Pytho

Re: Large Data Sets: Use base variables or classes? And some binding questions

2008-09-26 Thread Steven D'Aprano
On Fri, 26 Sep 2008 14:54:36 -0700, Carl Banks wrote: > However, it seems from the rest of your comments that speed is your main > concern. Last time someone reported __slots__ didn't make a big > difference in access time, but it probably would speed up creating > objects a bit. Carl probably

Re: is decorator the right thing to use?

2008-09-26 Thread Dmitry S. Makovey
Aaron "Castironpi" Brady wrote: > That prohibits using a descriptor in the proxied classes, or at least > the proxied functions, since you break descriptor protocol and only > call __get__ once. Better to cache and get by name. It's only slower > by the normal amount, and technically saves space,

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread skip
Aaron> Is there such a thing as an open-source spam filter? That way Aaron> any time anyone had spare time and got annoyed, they could dump a Aaron> short snippet of code into the grinder. Yes: though I think your model of how it works probably needs a bit

Re: Not fully OO ?

2008-09-26 Thread Tim Rowe
2008/9/26 Bruno Desthuilliers <[EMAIL PROTECTED]>: > Not to start a troll, but from what I've seen of C# so far I do find this a > bit surprising and really suspect more of a library issue than a language > one. Care to tell more about the problem and solution ? > > (NB : I wouldn't even asked if

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 6:31 am, [EMAIL PROTECTED] wrote: > I took over spam filter management for the python.org mailing lists a couple > months ago and made a few changes to the way the spam filter is trained. > Things seem to be at a reasonable level as far as I can tell (I see a few > spams leak through eac

Running IDLE on 3.0rc1

2008-09-26 Thread Terry Reedy
I have not seen this posted, so... To run IDLE with Python3.0rc1, edit Python30/Libs/idlelib/run.py, and change "set_daemon(True)" to "daemon = True" and save. (This is about line 75, and the only appearance of 'daemon'.) Otherwise, you get error message about not starting a subprocess. tjr -- h

Re: Not fully OO ?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 11:48 am, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > 2008/9/26 Tino Wildenhain <[EMAIL PROTECTED]>: > > >> The question I usually ask is "Does this language help me get the job > >> done?" Python often does. That's all that really matters, isn't it? > > > Well then it still depends on the p

Re: is decorator the right thing to use?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 3:03 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Dmitry S. Makovey a écrit : > > > > > Paul McGuire wrote: > >>> see, in your code you're assuming that there's only 1 property ( 'b' ) > >>> inside of A that needs proxying. In reality I have several. > > > >> No, really, Diez ha

Re: is decorator the right thing to use?

2008-09-26 Thread Dmitry S. Makovey
Bruno Desthuilliers wrote: > Hem... I'm afraid you don't really take Python's dynamic nature into > account here. Do you know that even the __class__ attribute of an > instance can be rebound at runtime ? What about 'once and for all' then ? must've been wrong wording on my part. Dynamic nature is

Re: Not fully OO ?

2008-09-26 Thread Bruno Desthuilliers
Tim Rowe a écrit : 2008/9/26 Tino Wildenhain <[EMAIL PROTECTED]>: The question I usually ask is "Does this language help me get the job done?" Python often does. That's all that really matters, isn't it? Well then it still depends on the perception of "job done". For example PHP programmers w

Re: Not fully OO ?

2008-09-26 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Fri, 26 Sep 2008 17:00:59 +0200, Bruno Desthuilliers wrote: Patrick Mullen a écrit : Depending on the scale of the website I am making, how much I care about editing it in the future, and how much I just want to get something up, I will occasionally use php. And

Re: Not fully OO ?

2008-09-26 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Fri, 26 Sep 2008 09:58:39 +0200, Bruno Desthuilliers wrote: "Procedural" is the opposite of "functional", not "object-oriented". AFAIK, the "opposite" if functional is imperative, not procedural. But let's not waste too much time on terminology arguments... We're

Re: Time.sleep(0.0125) not available within Linux

2008-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Grant Edwards wrote: > Never assume somebody reading the article and attempting to > help you can see the subject line. Why not? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
oops. i meant. ' in (%s)' % ','.join([str_edit_for_exploit(x) for x in aList]) On Fri, Sep 26, 2008 at 5:05 PM, Michael Mabin <[EMAIL PROTECTED]> wrote: > so you wouldn't object then to something like ' in (%)' % > ','.join([str_edit_for_exploit(x) for x in aList]) > > if

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
so you wouldn't object then to something like ' in (%)' % ','.join([str_edit_for_exploit(x) for x in aList]) if str_edit_for_exploit applied security edits? On Fri, Sep 26, 2008 at 2:28 PM, Benjamin Kaplan <[EMAIL PROTECTED]>wrote: > > > On Fri, Sep 26, 2008 at 3:04 PM, Michael Mabin

Re: is decorator the right thing to use?

2008-09-26 Thread Bruno Desthuilliers
Dmitry S. Makovey a écrit : Paul McGuire wrote: see, in your code you're assuming that there's only 1 property ( 'b' ) inside of A that needs proxying. In reality I have several. No, really, Diez has posted the canonical Proxy form in Python, using __getattr__ on the proxy, and then redirect

Re: Large Data Sets: Use base variables or classes? And some binding questions

2008-09-26 Thread Carl Banks
On Sep 26, 11:39 am, Patrick Sullivan <[EMAIL PROTECTED]> wrote: > Hello. Hi, I have a couple suggestions. > I will be using some large data sets ("points" from 2 to 12 variables) > and would like to use one class for each point rather than a list or > dictionary. Ok, point of terminology. It

Re: Matplotlib Polar Plot Angles/Axes

2008-09-26 Thread afrogazer
On Sep 26, 4:42 pm, Bas <[EMAIL PROTECTED]> wrote: > On Sep 26, 10:33 pm, afrogazer <[EMAIL PROTECTED]> wrote:> rad_angles = > [elem*(pi/180) for elem in angles] > > You are missing some more on a friday afternoon: angles is created by > arange, so it is a numpy array. In that case you simply can

Re: Matplotlib Polar Plot Angles/Axes

2008-09-26 Thread afrogazer
On Sep 26, 3:33 pm, afrogazer <[EMAIL PROTECTED]> wrote: > In my rush I seem to have overlooked that, maybe because it's Friday > afternoon. Converting the degrees to radians fixed it: > > rad_angles = [elem*(pi/180) for elem in angles] > > Thanks, One other caveat, some of the bars may over-lap.

Re: Matplotlib Polar Plot Angles/Axes

2008-09-26 Thread Bas
On Sep 26, 10:33 pm, afrogazer <[EMAIL PROTECTED]> wrote: > rad_angles = [elem*(pi/180) for elem in angles] You are missing some more on a friday afternoon: angles is created by arange, so it is a numpy array. In that case you simply can do rad_angles = pi/180 * angles No need to use list-comprehen

Re: how to search multiple textfiles ? (Python is slow ?)

2008-09-26 Thread Stef Mientki
Mike Driscoll wrote: On Sep 26, 8:35 am, Stef Mientki <[EMAIL PROTECTED]> wrote: hello, I want to search multiple textfiles (python source files) for a specific word. I can find all files, open them and do a search, but I guess that will be rather slow. I couldn't find any relevant informat

Re: Quick sort implementation in python

2008-09-26 Thread Martin v. Löwis
>> Can you please explain how you did that in C? IOW, how did you do >> the partition function (template) in case you don't have random >> access to the collection? >> > > Why exactly do you need random access for partition function? This is a counter-question, not an answer. Let me ask again: Ho

Re: Classes and functions.

2008-09-26 Thread Terry Reedy
aditya shukla wrote: Hello folks , i am using the newick module http://www.daimi.au.dk/~mailund/newick.html.I am just learning to use it and i have a question about it. from newick.tree import parse_tree from newick.tree import add_parent_links from newick.tree import add_distance_from_root

Re: Large Data Sets: Use base variables or classes? And some binding questions

2008-09-26 Thread Terry Reedy
Patrick Sullivan wrote: Hello. I will be using some large data sets ("points" from 2 to 12 variables) and would like to use one class for each point rather than a list or dictionary. I imagine this is terribly inefficient, but how much? I strongly suspect that you should use one class and a cl

Re: Test if list contains another list

2008-09-26 Thread bearophileHUGS
bearophile: > # searching > m, i = 0, 0 ... > i += 1 The name 'i' can be removed, sorry. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Terry Reedy
nntpman68 wrote: I guess you just filter mailing lists and can do nothing about the newsgroup if I'm fetching via the nntp server of my ISP itself, right? I am reading via gmane.comp.python.general, so I will benefit from filtering spam posted to c.l.p. Anyone with a news reader can do the

Re: ConfigParser subclass problem

2008-09-26 Thread Matimus
On Sep 26, 12:56 pm, Strato <[EMAIL PROTECTED]> wrote: > Hi folks, > > I think I do something wrong, but I don't see why it doesn't work, so I > will explain: > > I've searched in the list archive and found this thread, that explain > exactly what I want to have: the options strings returned by > C

Re: Test if list contains another list

2008-09-26 Thread bearophileHUGS
I suggest Python programmers to fill the holes in the Python std lib with some debugged & tuned implementations, their "bag of tricks", so they don't have to re-invent and debug things all the time. This works well with Psyco: def issubseq(sub, items): """issubseq(sub, items): return true if

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread nntpman68
Hm, I guess you just filter mailing lists and can do nothing about the newsgroup if I'm fetching via the nntp server of my ISP itself, right? I'm using Thunderbird as news reader and this is probably not the smartest news reader, though I like it a lot for mails. Is there any pythonable (o

Re: Matplotlib Polar Plot Angles/Axes

2008-09-26 Thread afrogazer
In my rush I seem to have overlooked that, maybe because it's Friday afternoon. Converting the degrees to radians fixed it: rad_angles = [elem*(pi/180) for elem in angles] Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: Quick sort implementation in python

2008-09-26 Thread sturlamolden
On 26 Sep, 08:43, Terry Reedy <[EMAIL PROTECTED]> wrote: > That depends on the data structure.  Access to a singly-linked list is > by linear scanning from the front. Which is one reason why mergesort i preferred over quicksort for lists. Pythons built-in sort is a variant of mergesort and should

Re: Large Data Sets: Use base variables or classes? And some binding questions

2008-09-26 Thread malkarouri
On 26 Sep, 16:39, Patrick Sullivan <[EMAIL PROTECTED]> wrote: > Hello. > > I will be using some large data sets ("points" from 2 to 12 variables) > and would like to use one class for each point rather than a list or > dictionary. I imagine this is terribly inefficient, but how much? I can't real

Classes and functions.

2008-09-26 Thread aditya shukla
Hello folks , i am using the newick module http://www.daimi.au.dk/~mailund/newick.html.I am just learning to use it and i have a question about it. from newick.tree import parse_tree from newick.tree import add_parent_links from newick.tree import add_distance_from_root import sys t = parse_t

Re: Fastest way to max() list

2008-09-26 Thread David Di Biase
Yeah, Apologies, it's been a long day for me. It works, just have to check if the nazis I'm doing this for will allow me to use object and NumPy. ack. Thanks again, Dave On Fri, Sep 26, 2008 at 2:08 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > On Fri, Sep 26, 2008 at 7:22 AM, David Di Biase <

Re: multiple processes, private working directories

2008-09-26 Thread Michael Palmer
On Sep 25, 8:16 am, "Tim Arnold" <[EMAIL PROTECTED]> wrote: > "Tim Arnold" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > >I have a bunch of processes to run and each one needs its own working > > directory. I'd also like to know when all of the processes are > > finished. > >

Re: Matplotlib Polar Plot Angles/Axes

2008-09-26 Thread Bas
I only have experience with the matlab version of polar, but my wild guess is that you have convert your degrees to radians. Go to the Matplotlib newsgroup if you need any better help. HTH, Bas -- http://mail.python.org/mailman/listinfo/python-list

ConfigParser subclass problem

2008-09-26 Thread Strato
Hi folks, I think I do something wrong, but I don't see why it doesn't work, so I will explain: I've searched in the list archive and found this thread, that explain exactly what I want to have: the options strings returned by ConfigParser without being lower cased. I tryed to reproduce th

Re: Python is slow?

2008-09-26 Thread James Matthews
+1 QOTW... On Tue, Sep 23, 2008 at 7:13 AM, George Sakkis <[EMAIL PROTECTED]>wrote: > On Sep 23, 9:57 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > > > On 2008-09-23, sturlamolden <[EMAIL PROTECTED]> wrote: > > > > [...] > > > > > After having a working Python prototype, I resorted to rewrite th

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Benjamin Kaplan
On Fri, Sep 26, 2008 at 3:04 PM, Michael Mabin <[EMAIL PROTECTED]> wrote: > Doesn't it depend on where and why you intend to execute the code? > Obviously some SQL is more at risk for exploit when the input is from the > screen on a web page than if you were running parameterized code in a > contr

Re: Test if list contains another list

2008-09-26 Thread Derek Martin
On Thu, Sep 18, 2008 at 03:24:16AM -0700, [EMAIL PROTECTED] wrote: > I looked inside this thread for my query which brought me the > following google search result > "Test if list contains another list - comp.lang.python | Google > Groups" > > But then I was disappointed to see the question asked

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread D'Arcy J.M. Cain
On Fri, 26 Sep 2008 14:04:35 -0500 "Michael Mabin" <[EMAIL PROTECTED]> wrote: > Doesn't it depend on where and why you intend to execute the code? > Obviously some SQL is more at risk for exploit when the input is from the > screen on a web page than if you were running parameterized code in a > co

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Jean-Paul Calderone
On Fri, 26 Sep 2008 14:04:35 -0500, Michael Mabin <[EMAIL PROTECTED]> wrote: Doesn't it depend on where and why you intend to execute the code? Obviously some SQL is more at risk for exploit when the input is from the screen on a web page than if you were running parameterized code in a controlle

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Paul Boddie
On 26 Sep, 12:15, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Fri, 26 Sep 2008 02:32:50 -0700 (PDT), bcurtu wrote: > > I have a BIG problem with the next query: > > > cursor.execute(""" > > SELECT titem.object_id, titem.tag_id > > FROM tagging_

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
Doesn't it depend on where and why you intend to execute the code? Obviously some SQL is more at risk for exploit when the input is from the screen on a web page than if you were running parameterized code in a controlled batch environment. Or if you were writing code generators (which is what I h

Re: how to search multiple textfiles ?

2008-09-26 Thread Sean DiZazzo
On Sep 26, 6:35 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > I want to search multiple textfiles (python source files) for a specific > word. > I can find all files, open them and do a search, > but I guess that will be rather slow. > > I couldn't find any relevant information through

Re: Writing a well-behaved daemon

2008-09-26 Thread Sean DiZazzo
On Sep 26, 12:13 am, Ben Finney <[EMAIL PROTECTED]> wrote: > Sean DiZazzo <[EMAIL PROTECTED]> writes: > > Looks like somebody did the same thing I did and posted it. > > >http://svn.plone.org/svn/collective/bda.daemon/trunk/bda/daemon/daemo... > > Thanks, I've not seen that before. > > It still see

Re: Not fully OO ?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 11:48 am, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > 2008/9/26 Tino Wildenhain <[EMAIL PROTECTED]>: > > >> The question I usually ask is "Does this language help me get the job > >> done?" Python often does. That's all that really matters, isn't it? > > > Well then it still depends on the

Re: Fastest way to max() list

2008-09-26 Thread Chris Rebert
On Fri, Sep 26, 2008 at 7:22 AM, David Di Biase <[EMAIL PROTECTED]> wrote: > Hi Chris, > > Yeah I hear you on point A. but this the specification I was given, so I > have to follow it unfortunately. I've also been restricted and not allowed > to use any other packages. I was using NumPy earlier (sh

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 11:43 am, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > 2008/9/26 Steven D'Aprano <[EMAIL PROTECTED]>: > > > I don't have any objective numbers, but subjectively it seems to me that > > the number of spams is significantly higher, but not so high as to be a > > major nuisance. > > I consider *

Re: Building truth tables

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 11:40 am, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > 2008/9/26 andrea <[EMAIL PROTECTED]>: > > > Well I would like to make a little program that given a certain > > logical expression gives the complete truth table. > > > It's not too difficult in fact, I just have some doubts on how to > >

Re: is decorator the right thing to use?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 10:41 am, "Dmitry S. Makovey" <[EMAIL PROTECTED]> wrote: > Paul McGuire wrote: > > If you need to get fancier and support this single-proxy-to-multiple- > > delegates form, then yes, you will need some kind of map that says > > which method should delegate to which object.  Or, if it is

Matplotlib Polar Plot Angles/Axes

2008-09-26 Thread afrogazer
I am creating a wind rose using a polar bar plot bu the points do not seem to align to the correct angles. Here is the sample code I am using. I can't seem to see anything in the API on how to set the angles. Any ideas anybody? Thanks. from pylab import * angles = arange(0,360,45) data = [18, 1

Re: Understanding (and getting rid) of optparse.py:668: FutureWarning: %u/%o/%x/%X of negative int will return a

2008-09-26 Thread hofer
On Sep 26, 6:21 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > hofer wrote: > > Hi, > > > I get following warning with a python script: > > > optparse.py:668: FutureWarning: %u/%o/%x/%X of negative int will > > return a signed string in Python 2.4 and up > > You can print options.__dict__ instead of

Re: Quick sort implementation in python

2008-09-26 Thread Alex Snast
On Sep 25, 11:47 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Now as you can see I'm passing my list object to both functions along > > with their first, last indices > > I cannot really see that. More specifically, it isn't definite what the > type of the "a" argument is, nor does the spec

Re: how to search multiple textfiles ?

2008-09-26 Thread Paul Rubin
Stef Mientki <[EMAIL PROTECTED]> writes: > Does anyone know of a search library that performs this task fast ? You mean you want a Python search engine (with inverted indexes and all that)? Try: nucular.sf.net -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the filename in the right case ?

2008-09-26 Thread Stef Mientki
Steven D'Aprano wrote: On Fri, 26 Sep 2008 01:46:15 +0200, Stef Mientki wrote: Secondly thoughtless copying of current behavior, doesn't bring any progress, and I think that's one of the reasons why we're still burdened by inventions done 20 years ago, e.g. "do you want to save your changes

Re: lxml question

2008-09-26 Thread Mark Thomas
On Sep 26, 11:19 am, Uwe Schmitt <[EMAIL PROTECTED]> wrote: > I have to parse some text which pretends to be XML. lxml does not want > to parse it, because it lacks a root element. > I think that this situation is not unusual, so: is there a way to > force lxml to parse it ? By "pretends to be XML

Re: Not fully OO ?

2008-09-26 Thread Tim Rowe
2008/9/26 Tino Wildenhain <[EMAIL PROTECTED]>: >> The question I usually ask is "Does this language help me get the job >> done?" Python often does. That's all that really matters, isn't it? > > Well then it still depends on the perception of "job done". For example > PHP programmers would bet the

Re: Time.sleep(0.0125) not available within Linux

2008-09-26 Thread Edel SM
helllo, On Fri, Sep 26, 2008 at 3:46 PM, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In message <[EMAIL PROTECTED]>, Steven D'Aprano > wrote: > >> On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote: >> >>> Just a thought, your minimum sleep time is probably limited by the >>> resol

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Tim Rowe
2008/9/26 Steven D'Aprano <[EMAIL PROTECTED]>: > I don't have any objective numbers, but subjectively it seems to me that > the number of spams is significantly higher, but not so high as to be a > major nuisance. I consider *any* spam to be a major nuisance, but I don't see them as being the fau

Re: Building truth tables

2008-09-26 Thread Tim Rowe
2008/9/26 andrea <[EMAIL PROTECTED]>: > Well I would like to make a little program that given a certain > logical expression gives the complete truth table. > > It's not too difficult in fact, I just have some doubts on how to > design it. > > I thought something like that: > > class Term: > > clas

  1   2   >