Re: Obnoxious postings from Google Groups

2012-10-30 Thread Robert Miles
On 9/16/2012 8:14 PM, alex23 wrote: On Sep 17, 10:55 am, Roy Smith wrote: They didn't buy the service. They bought the data. Well, they really bought both, but the data is all they wanted. I thought they'd taken most of the historical data offline now too? Some of it, but they still had m

Re: Negative array indicies and slice()

2012-10-30 Thread Michael Torrie
On 10/30/2012 09:47 AM, Andrew Robinson wrote: > Let's not confound an issue here -- I am going to implement the python > interpreter; and am not bound by optimization considerations of the > present python interpreter -- There are things I can do which as a > python programmer -- you can't. I

RE: Negative array indicies and slice()

2012-10-30 Thread Andrew Robinson
Ian, > Looks like it's already been wontfixed back in 2006: > http://bugs.python.org/issue1501180 Absolutely bloody typical, turned down because of an idiot. Who the hell is Tim Peters anyway? > I don't really disagree with him, anyway. It is a rather obscure bug > -- is it worth increasi

Re: Obnoxious postings from Google Groups

2012-10-30 Thread Robert Miles
On 9/16/2012 10:44 AM, pandora.ko...@gmail.com wrote: Whaen i tried to post just now by hitting sumbit, google groups told me that the following addresssed has benn found in this thread! i guess is used them all to notify everything! cdf072b2-7359-4417-b1e4-d984e4317...@googlegroups.com mailma

Re: Obnoxious postings from Google Groups

2012-10-30 Thread Robert Miles
On 9/16/2012 8:18 AM, Ben Finney wrote: Νικόλαος Κούρας writes: Iam sorry i didnt do that on purpose and i dont know how this is done. Iam positng via google groups using chrome, thats all i know. It is becoming quite clear that some change has happened recently to Google Groups that makes

Re: Negative array indicies and slice()

2012-10-30 Thread Andrew Robinson
On 10/30/2012 04:48 PM, Mark Lawrence wrote: On 30/10/2012 15:47, Andrew Robinson wrote: I would refer you to a book written by Steve Maguire, Writing Solid Code; Chapter 5; Candy machine interfaces. The book that took a right hammering here http://accu.org/index.php?module=bookreviews&func

Re: Immutability and Python

2012-10-30 Thread rusi
On Oct 31, 1:45 am, Neal Becker wrote: > rusi wrote: > > On Oct 29, 8:20 pm, andrea crotti wrote: > > > >> Any comments about this? What do you prefer and why? > > > Im not sure how what the 'prefer' is about -- your specific num > > wrapper or is it about the general question of choosing mutabl

Re: Negative array indicies and slice()

2012-10-30 Thread Mark Lawrence
On 30/10/2012 15:47, Andrew Robinson wrote: I would refer you to a book written by Steve Maguire, Writing Solid Code; Chapter 5; Candy machine interfaces. The book that took a right hammering here http://accu.org/index.php?module=bookreviews&func=search&rid=467 ? -- Cheers. Mark Lawrence.

Re: Negative array indicies and slice()

2012-10-30 Thread Mark Lawrence
On 30/10/2012 21:47, Ian Kelly wrote: On Tue, Oct 30, 2012 at 3:33 PM, Mark Lawrence wrote: On 30/10/2012 18:02, Ian Kelly wrote: On Tue, Oct 30, 2012 at 10:14 AM, Ethan Furman wrote: File a bug report? Looks like it's already been wontfixed back in 2006: http://bugs.python.org/issue15

Re: Negative array indicies and slice()

2012-10-30 Thread Andrew Robinson
On 10/30/2012 01:17 AM, Steven D'Aprano wrote: By the way Andrew, the timestamps on your emails appear to be off, or possibly the time zone. Your posts are allegedly arriving before the posts you reply to, at least according to my news client. :D -- yes, I know about that problem. Every time I r

Re: Negative array indicies and slice()

2012-10-30 Thread Ian Kelly
On Tue, Oct 30, 2012 at 3:55 PM, Ian Kelly wrote: > On Tue, Oct 30, 2012 at 8:21 AM, Andrew Robinson > wrote: >> D'Apriano mentioned the named values, start, stop, step in a slice() which >> are an API and legacy issue; These three names must also be stored in the >> interpreter someplace. Sinc

Re: Negative array indicies and slice()

2012-10-30 Thread Chris Angelico
On Wed, Oct 31, 2012 at 8:47 AM, Ian Kelly wrote: > On Tue, Oct 30, 2012 at 3:33 PM, Mark Lawrence > wrote: >> On 30/10/2012 18:02, Ian Kelly wrote: >>> >>> On Tue, Oct 30, 2012 at 10:14 AM, Ethan Furman wrote: File a bug report? >>> >>> >>> Looks like it's already been wontfixed back

Re: Negative array indicies and slice()

2012-10-30 Thread Ian Kelly
On Tue, Oct 30, 2012 at 8:21 AM, Andrew Robinson wrote: > D'Apriano mentioned the named values, start, stop, step in a slice() which > are an API and legacy issue; These three names must also be stored in the > interpreter someplace. Since slice is defined at the "C" level as a struct, > have yo

Re: Negative array indicies and slice()

2012-10-30 Thread Ian Kelly
On Tue, Oct 30, 2012 at 3:33 PM, Mark Lawrence wrote: > On 30/10/2012 18:02, Ian Kelly wrote: >> >> On Tue, Oct 30, 2012 at 10:14 AM, Ethan Furman wrote: >>> >>> File a bug report? >> >> >> Looks like it's already been wontfixed back in 2006: >> >> http://bugs.python.org/issue1501180 >> > > Absol

Re: Negative array indicies and slice()

2012-10-30 Thread Mark Lawrence
On 30/10/2012 18:02, Ian Kelly wrote: On Tue, Oct 30, 2012 at 10:14 AM, Ethan Furman wrote: File a bug report? Looks like it's already been wontfixed back in 2006: http://bugs.python.org/issue1501180 Absolutely bloody typical, turned down because of an idiot. Who the hell is Tim Peters

Re: Negative array indicies and slice()

2012-10-30 Thread Ethan Furman
Andrew Robinson wrote: I can see that the slice() function can pass in arbitrary arguments. I'm not sure for lists, which is what the range is applied to, why an argument like "a" would be part of a slice. Well, in my dbf.py Record class you can use the names of fields as the slice arguments,

Re: calling one staticmethod from another

2012-10-30 Thread Mark Lawrence
On 30/10/2012 12:25, Ulrich Eckhardt wrote: Hi! I can call a staticmethod f() of class C like "C.f()" or with an instance like "C().f()". Inside that staticmethod, I have neither the class (at least not the original one) nor do I have an instance, so I can't call a different staticmethod from th

Re: Negative array indicies and slice()

2012-10-30 Thread Andrew Robinson
On 10/30/2012 11:02 AM, Ian Kelly wrote: On Tue, Oct 30, 2012 at 10:14 AM, Ethan Furman wrote: File a bug report? Looks like it's already been wontfixed back in 2006: http://bugs.python.org/issue1501180 Thanks, IAN, you've answered the first of my questions and have been a great help. (And y

Re: Immutability and Python

2012-10-30 Thread Neal Becker
rusi wrote: > On Oct 29, 8:20 pm, andrea crotti wrote: > >> Any comments about this? What do you prefer and why? > > Im not sure how what the 'prefer' is about -- your specific num > wrapper or is it about the general question of choosing mutable or > immutable types? > > If the latter I would

Splitting large packages with distutils

2012-10-30 Thread Joost Molenaar
Hello list, suppose I have three packages like this: ingredients-base/ ingredients/ __init__.py setup.py <-- this one only references package ingredients ingredients-spam/ ingredients/ __init__.py spam/ __init__.py recipe.py setup

Re: calling one staticmethod from another

2012-10-30 Thread Jean-Michel Pichavant
- Original Message - [snip] > I haven't figured out the justification for staticmethod, http://en.wikipedia.org/wiki/Namespace + "Namespaces are one honking great idea -- let's do more of those!" Someone may successfully use only modules as namespaces, but classes can be used as well.

Re: Negative array indicies and slice()

2012-10-30 Thread Ian Kelly
On Tue, Oct 30, 2012 at 10:14 AM, Ethan Furman wrote: > File a bug report? Looks like it's already been wontfixed back in 2006: http://bugs.python.org/issue1501180 -- http://mail.python.org/mailman/listinfo/python-list

Re: Immutability and Python

2012-10-30 Thread rusi
On Oct 29, 8:20 pm, andrea crotti wrote: > Any comments about this? What do you prefer and why? Im not sure how what the 'prefer' is about -- your specific num wrapper or is it about the general question of choosing mutable or immutable types? If the latter I would suggest you read http://en.wi

Re: calling one staticmethod from another

2012-10-30 Thread Ulrich Eckhardt
Am 30.10.2012 14:47, schrieb Dave Angel: I'd think the obvious solution is to move both the functions outside of the class. I haven't figured out the justification for staticmethod, except for java or C++ converts. Although I come from a C++ background, I think static functions have solid rea

Re: calling one staticmethod from another

2012-10-30 Thread Ian Kelly
On Tue, Oct 30, 2012 at 7:41 AM, Ethan Furman wrote: > class Spam(): > @staticmethod > def green(): > print('on a train!') > @staticmethod > def question(): > print('would you, could you', end='') > Spam.green() > > It can be a pain if you change the class n

Re: Float to String "%.7e" - diff between Python-2.6 and Python-2.7

2012-10-30 Thread Dave Angel
On 10/30/2012 10:47 AM, andrew.macke...@3ds.com wrote: > When formatting a float using the exponential format, the rounding is > different in Python-2.6 and Python-2.7. See example below. > Is this intentional? > > Is there any way of forcing the Python-2.6 behavior (for compatibility > reasons w

Re: Float to String "%.7e" - diff between Python-2.6 and Python-2.7

2012-10-30 Thread Duncan Booth
andrew.macke...@3ds.com wrote: > When formatting a float using the exponential format, the rounding is > different in Python-2.6 and Python-2.7. See example below. Is this > intentional? > > Is there any way of forcing the Python-2.6 behavior (for compatibility > reasons when testing)? > It is

Float to String "%.7e" - diff between Python-2.6 and Python-2.7

2012-10-30 Thread andrew . mackeith
When formatting a float using the exponential format, the rounding is different in Python-2.6 and Python-2.7. See example below. Is this intentional? Is there any way of forcing the Python-2.6 behavior (for compatibility reasons when testing)? >c:\python26\python r:\asiData\abaObjects\lib>c:\py

RE: how to change os.popen4 to subprocess

2012-10-30 Thread Prasad, Ramit
Replying to skyworld because I could not find the original message from MRAB. skyworld wrote: > On Oct 27, 11:02 am, MRAB wrote: > > On 2012-10-27 03:28, skyworld wrote:> Hi, > > > > > I'm new to python and I'm trying to porting some scripts from v0.96 to > > > v2.0.1. A piece of code is like thi

Re: Nice solution wanted: Hide internal interfaces

2012-10-30 Thread andrea crotti
2012/10/30 alex23 : > On Oct 30, 2:33 am, Johannes Bauer wrote: >> I'm currently looking for a good solution to the following problem: I >> have two classes A and B, which interact with each other and which >> interact with the user. Instances of B are always created by A. >> >> Now I want A to ca

shannan is so good at giving head pt 22

2012-10-30 Thread Constantine
shannan is so good at giving head pt 22 http://www.google.com/search?hl=en&q=shannan+is+so+good+at+giving+head+pt+22+site:ryurikpiroumita.blogspot.com&btnI=I%27m+Feeling+Lucky -- http://mail.python.org/mailman/listinfo/python-list

Re: calling one staticmethod from another

2012-10-30 Thread Dave Angel
On 10/30/2012 08:25 AM, Ulrich Eckhardt wrote: > Hi! > > I can call a staticmethod f() of class C like "C.f()" or with an > instance like "C().f()". Inside that staticmethod, I have neither the > class (at least not the original one) nor do I have an instance, so I > can't call a different staticme

Re: calling one staticmethod from another

2012-10-30 Thread Ethan Furman
Ulrich Eckhardt wrote: I can call a staticmethod f() of class C like "C.f()" or with an instance like "C().f()". Inside that staticmethod, I have neither the class (at least not the original one) nor do I have an instance, so I can't call a different staticmethod from the same class. The obviou

Re: exec with partial globals

2012-10-30 Thread Dave Angel
On 10/30/2012 08:57 AM, Helmut Jarausch wrote: > On Tue, 30 Oct 2012 08:33:38 -0400, Dave Angel wrote: > >> On 10/30/2012 08:00 AM, Helmut Jarausch wrote: >>> Hi, >>> >>> I'd like to give the user the ability to enter code which may only rebind >>> a given set of names but not all ones. >>> This do

calling one staticmethod from another

2012-10-30 Thread Ulrich Eckhardt
Hi! I can call a staticmethod f() of class C like "C.f()" or with an instance like "C().f()". Inside that staticmethod, I have neither the class (at least not the original one) nor do I have an instance, so I can't call a different staticmethod from the same class. The obvious solution is to

Re: exec with partial globals

2012-10-30 Thread Chris Angelico
On Tue, Oct 30, 2012 at 11:57 PM, Helmut Jarausch wrote: > Given spreadsheet S (Source) and D (Destination) as objects (wrapping a > dictionary) a possible (legal) input would be > > D.price= D.price-S.discount > > No other fields of 'D' should be modifiable. That's a bit harder. What you're des

Re: exec with partial globals

2012-10-30 Thread Helmut Jarausch
On Tue, 30 Oct 2012 08:33:38 -0400, Dave Angel wrote: > On 10/30/2012 08:00 AM, Helmut Jarausch wrote: >> Hi, >> >> I'd like to give the user the ability to enter code which may only rebind >> a given set of names but not all ones. >> This does NOT work >> A=1 >> B=2 >> Code=compile('A=7','','exec

Re: problems with xml parsing (python 3.3)

2012-10-30 Thread jannidis
If someone comes across this posting with the same problem, the best answer seems to be: avoid Pythons xml.etree.ElementTree and use this library instead: http://lxml.de/ It works like expected and supports xpath much better. -- http://mail.python.org/mailman/listinfo/python-list

Re: exec with partial globals

2012-10-30 Thread Dave Angel
On 10/30/2012 08:00 AM, Helmut Jarausch wrote: > Hi, > > I'd like to give the user the ability to enter code which may only rebind > a given set of names but not all ones. > This does NOT work > A=1 > B=2 > Code=compile('A=7','','exec') > exec(Code,{'A':0}) > print("I've got A={}".format(A)) # prin

Re: exec with partial globals

2012-10-30 Thread Chris Angelico
On Tue, Oct 30, 2012 at 11:00 PM, Helmut Jarausch wrote: > Hi, > > I'd like to give the user the ability to enter code which may only rebind > a given set of names but not all ones. > > How can 'filter' the gobal namespace such that modifying 'A' is allowed > but any attempt to modify 'B' should g

exec with partial globals

2012-10-30 Thread Helmut Jarausch
Hi, I'd like to give the user the ability to enter code which may only rebind a given set of names but not all ones. This does NOT work A=1 B=2 Code=compile('A=7','','exec') exec(Code,{'A':0}) print("I've got A={}".format(A)) # prints 1 How can 'filter' the gobal namespace such that modifying 'A

Re: I need help installing pypng in Python 3.3

2012-10-30 Thread icgwh
On Monday, October 29, 2012 3:48:09 PM UTC+1, Andrew Robinson wrote: > On 10/29/2012 06:39 AM, ic...@tagyourself.com wrote: > > > That's very kind of you but I don't think it would be particularly fitted > > to my needs. The program I'm trying to code creates an image as an 2D array > > of "pixe

Re: date and time comparison how to

2012-10-30 Thread Dave Angel
On 10/30/2012 12:20 AM, noydb wrote: > On Monday, October 29, 2012 11:11:55 PM UTC-4, Dave Angel wrote: >> On 10/29/2012 10:13 PM, noydb wrote: >> >>> I guess I get there eventually! >> >>> >> >> > > okay, I see. > But for the user supplied date... I'm not sure of the format just yet... > test

Re: Negative array indicies and slice()

2012-10-30 Thread Ian Kelly
On Tue, Oct 30, 2012 at 1:21 AM, Ian Kelly wrote: > I'm not entirely certain why collection objects get this special > treatment, but there you have it. Thinking about it some more, this makes sense. The GC header is there to support garbage collection for the object. Atomic types like ints do

Re: Negative array indicies and slice()

2012-10-30 Thread Steven D'Aprano
By the way Andrew, the timestamps on your emails appear to be off, or possibly the time zone. Your posts are allegedly arriving before the posts you reply to, at least according to my news client. On Mon, 29 Oct 2012 12:34:24 -0700, Andrew Robinson wrote: > On 10/29/2012 05:02 PM, Steven D'Apr

Re: Negative array indicies and slice()

2012-10-30 Thread Ian Kelly
On Mon, Oct 29, 2012 at 5:54 PM, Andrew Robinson wrote: >> I don't know of a reason why one might need to use a negative start >> with a positive stop, though. > > I've already given several examples; and another poster did too I meant that I don't know of a reason to do that given the existing s

Re: Negative array indicies and slice()

2012-10-30 Thread Ian Kelly
On Mon, Oct 29, 2012 at 6:17 PM, Andrew Robinson wrote: > If you re-check my post to chris, I listed the struct you mention. > The C code is what is actually run (by GDB breakpoint test) when a tuple is > instantiated. When you were running GDB, were you debugging the interactive interpreter or a

Re: Negative array indicies and slice()

2012-10-30 Thread Ian Kelly
On Mon, Oct 29, 2012 at 7:49 PM, Chris Kaynor wrote: > NOTE: The above is taken from reading the source code for Python 2.6. > For some odd reason, I am getting that an empty tuple consists of 6 > pointer-sized objects (48 bytes on x64), rather than the expected 3 > pointer-sized (24 bytes on x64)

Re: Negative array indicies and slice()

2012-10-30 Thread Andrew Robinson
On 10/29/2012 11:51 PM, Ian Kelly wrote: On Mon, Oct 29, 2012 at 4:39 PM, Andrew Robinson As above, you're looking at the compiler code, which is why you're finding things like "line" and "column". The tuple struct is defined in tupleobject.h and stores tuple elements in a tail array. If you

Re: Negative array indicies and slice()

2012-10-30 Thread Andrew Robinson
On 10/29/2012 10:53 PM, Michael Torrie wrote: On 10/29/2012 01:34 PM, Andrew Robinson wrote: No, I don't think it big and complicated. I do think it has timing implications which are undesirable because of how *much* slices are used. In an embedded target -- I have to optimize; and I will have