Re: Inheriting Object

2011-05-20 Thread Ian Kelly
On Thu, May 19, 2011 at 10:11 PM, Navkirat Singh wrote: > Thanks Guys...I will look deeper into this. I thought I read somewhere that > it was required in older python releases, but in newer releases it is not. I > might be wrong though. In Python 3.x all classes inherit from object by default, s

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Roland Hutchinson
On Wed, 18 May 2011 07:19:08 +0200, Pascal J. Bourguignon wrote: > Roland Hutchinson writes: > >> Sorry to have to contradict you, > > Don't be sorry. > > >> but it really is a textbook example of recursion. Try this psuedo-code >> on for size: >> >> FUNCTION DIR-DELETE (directory) >> FOR

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Steven D'Aprano
On Thu, 19 May 2011 22:13:14 -0700, rusi wrote: > [I agree with you Xah that recursion is a technical word that should not > be foisted onto lay users.] I think that is a patronizing remark that under-estimates the intelligence of lay people and over-estimates the difficulty of understanding re

Re: obviscating python code for distribution

2011-05-20 Thread Steven D'Aprano
On Fri, 20 May 2011 05:48:50 +0100, Hans Georg Schaathun wrote: > Either way, the assumption that your system will not be handled by > idiots is only reasonable if you yourself is the only user. Nonsense. How do you (generic "you", not any specific person) know that you are not an idiot? If you

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Jonathan de Boyne Pollard
〈English Idiom in Unix: Directory Recursively〉 http://xahlee.org/comp/idiom_directory_recursively.html -- English Idiom in Unix: Directory Recursively Xah Lee, 2011-05-17 Today, let's discuss something in the category of lingustics. You know how in unix

embedding and extending on windows

2011-05-20 Thread rusi
A client wants to 'be lectured' on extending and embedding python on windows. I am familiar with this (or was until python2.3 or thereabouts) on linux -- never done it on windows. Can some kind soul point me to some link on the issues/pitfalls re this? I see three choices: 1. Us MS C for the C ex

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Jonathan de Boyne Pollard
AFAICS what emacs calls "recursive delete" is what the ordinary person would simply call "delete". Presumably the non-recursive delete is called simply "delete" but is actually something more complicated than delete, and you're supposed to know what that is. The "non-recursive delete" would be

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Chris Angelico
On Wed, 18 May 2011 12:59:45 -0500, Victor Eijkhout wrote: > Recursion: (N). See recursion. See also tail recursion. caching proxy (n): If you already know what recursion is, this is the same. Otherwise, see recursion. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: obviscating python code for distribution

2011-05-20 Thread Steven D'Aprano
On Thu, 19 May 2011 17:56:12 -0700, geremy condra wrote: > TL;DR version: large systems have indeed been verified for their > security properties. How confident are we that the verification software is sufficiently bug- free that we should trust their results? How confident are we that the verif

Re: hash values and equality

2011-05-20 Thread Ulrich Eckhardt
Ethan Furman wrote: > Several folk have said that objects that compare equal must hash equal, > and the docs also state this > http://docs.python.org/dev/reference/datamodel.html#object.__hash__ > > I'm hoping somebody can tell me what horrible thing will happen if this > isn't the case? If you w

Re: Faster Recursive Fibonacci Numbers

2011-05-20 Thread Ian Kelly
On Thu, May 19, 2011 at 11:58 PM, Steven D'Aprano wrote: > Sure, which is why the above fib() function will become increasing > inaccurate beyond some given n, by memory about n=71 or so. Er, at least > the fib() function that *was* above until you deleted most of it :) > > If you want an *accurat

Re: Faster Recursive Fibonacci Numbers

2011-05-20 Thread Ian Kelly
2011/5/20 Ian Kelly : > def fib_decimal(n): >    with localcontext() as ctx: >        ctx.prec = n // 4 + 1 >        sqrt_5 = Decimal('5').sqrt() >        phi = (1 + sqrt_5) / 2 >        numerator = (phi ** n) - (1 - phi) ** n >        return int((numerator / sqrt_5).to_integral_value()) Note that

Re: connect SIGINT to custom interrupt handler

2011-05-20 Thread Thomas 'PointedEars' Lahn
Christoph Scheingraber wrote: > On 2011-05-15, Thomas 'PointedEars' Lahn wrote: >> Obviously. `signal' refers to an `int' object, probably by something >> like >> >> signal = 42 >> >> before. E.g. `print' or a debugger will tell you, as you have not showed >> the relevant parts of the code. >

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Jonathan de Boyne Pollard
I think what happens is that the “recursive” has become a idiom associated with directory to such a degree that the unix people don't know what the fuck they are talking about. They just simply use the word to go with directory whever they mean the whole directory. In the emacs case: “Recursiv

Re: os.access giving incorrect results on Windows

2011-05-20 Thread Tim Golden
On 19/05/2011 21:40, Andrew Berg wrote: On 2011.05.19 03:08 PM, Tim Golden wrote: * A R_OK check always succeeds if the file's attributes can be read at all So is this the same as F_OK then, or does it return false if the user isn't allowed to read permissions? * A W_OK check fails if the

Re: os.access giving incorrect results on Windows

2011-05-20 Thread Tim Golden
On 20/05/2011 09:21, Tim Golden wrote: [... re os.access on Windows ...] (Sorry; just got back to this this morning). I might raise this on python-dev. If you want to follow, my post is here: http://mail.python.org/pipermail/python-dev/2011-May/111530.html TJG -- http://mail.python.org/ma

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Hans Georg Schaathun
On 20 May 2011 06:55:35 GMT, Steven D'Aprano wrote: : On Thu, 19 May 2011 22:13:14 -0700, rusi wrote: : : > [I agree with you Xah that recursion is a technical word that should not : > be foisted onto lay users.] : : I think that is a patronizing remark that under-estimates the : intellige

Re: obviscating python code for distribution

2011-05-20 Thread Hans Georg Schaathun
On 20 May 2011 07:04:27 GMT, Steven D'Aprano wrote: : On Fri, 20 May 2011 05:48:50 +0100, Hans Georg Schaathun wrote: : : > Either way, the assumption that your system will not be handled by : > idiots is only reasonable if you yourself is the only user. : : Nonsense. How do you (generic "yo

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Antti J Ylikoski
On 20.5.2011 3:38, Pascal J. Bourguignon wrote: t...@sevak.isi.edu (Thomas A. Russ) writes: "Pascal J. Bourguignon" writes: t...@sevak.isi.edu (Thomas A. Russ) writes: This will only work if there is a backpointer to the parent. No, you don't need backpointers; some cases have been menti

Re: obviscating python code for distribution

2011-05-20 Thread Disc Magnet
On Mon, May 16, 2011 at 9:06 AM, Littlefield, Tyler wrote: > I'm putting lots of work into this. I would rather not have some script > kiddy dig through it, yank out chunks and do whatever he wants. I just want > to distribute the program as-is, not distribute it and leave it open to > being hacke

RE: starting a separate thread in maya

2011-05-20 Thread Andreas Tawn
> Hi, > I'm using python2.5 in maya 2009 x64 (in linux). For Maya/Python stuff you'll probably have more success at http://www.tech-artists.org/ Cheers, Drea -- http://mail.python.org/mailman/listinfo/python-list

Re: turn monitor off and on

2011-05-20 Thread Jack Krieger
> def turnOffMonitor(): > SC_MONITORPOWER = 0xF170 > win32gui.SendMessage(win32con.HWND_BROADCAST, > win32con.WM_SYSCOMMAND, SC_MONITORPOWER, 2) This code does not return control to you, so programm still locked. In my opinion it due broadcasting message. But I do not know how to send message

Re: turn monitor off and on

2011-05-20 Thread Leotis buchanan
@Astan If you really want to turn your monitor on and off, you should probably try pyserial are pyparrallel(http://pyserial.sourceforge.net/pyparallel.html), along with a solid state relay. That worked for me on linux not sure about windowXP,but it should work. On Sat, May 14, 2011 at 1:08 AM, As

Re: Faster Recursive Fibonacci Numbers

2011-05-20 Thread SigmundV
There is a nice matrix representation of consecutive Fibonacci numbers: [[1, 1], [1, 0]] ** n = [[F_n+1, F_n], [F_n, F_n-1]]. Using the third party mpmath module, which uses arbitrary precision floating point arithmetic, we can calculate the n'th Fibonacci number for an arbitrary n as follows: imp

Re: os.access giving incorrect results on Windows

2011-05-20 Thread Ayaskanta Swain
Hi Tim, Thanks for the reply and suggestions. I followed the patch provided by you in issue 2528, but the code looks very tricky to me. Anyways I wrote my Test.py script & tried only the def test_access_w(self): test case which is defined under class FileTests(unittest.TestCase) by providing my

Python sets which support multiple same elements

2011-05-20 Thread ErichCart ErichCart
Many times when I am writing some program in python, I notice that I could transform my list into set, then use the set methods like union, intersection, set equality etc. , and it will solve my problem easily. But then I realize that if I transform my list into set, it will remove duplicates of el

Re: Python sets which support multiple same elements

2011-05-20 Thread Shunichi Wakabayashi
> Many times when I am writing some program in python, I notice that I > could transform my list into set, then use the set methods like union, > intersection, set equality etc. , and it will solve my problem easily. > But then I realize that if I transform my list into set, it will > remove duplic

RE: Python sets which support multiple same elements

2011-05-20 Thread Andreas Tawn
> For example, I was writing a program to detect whether two strings are > anagrams of each other. I had to write it like this: > > def isAnagram(w1, w2): > w2=list(w2) > for c in w1: > if c not in w2: > return False > else: > w2.remove(c) > return True > > But if there

Re: Python sets which support multiple same elements

2011-05-20 Thread Chris Angelico
On Fri, May 20, 2011 at 9:37 PM, ErichCart ErichCart wrote: > For example, I was writing a program to detect whether two strings are > anagrams of each other. I had to write it like this: > > def isAnagram(w1, w2): >  w2=list(w2) >  for c in w1: >    if c not in w2: >      return False >    else:

Re: Python sets which support multiple same elements

2011-05-20 Thread ErichCart ErichCart
I see! How could I overlook sorting )) It seems that collections.Counter is what I was talking about. It seems to support all the set operations. Also I realized that the data structure which i was describing is called miltiset, and collections.Counter is python implementation of multiset. -- ht

Re: how to get PID from subprocess library

2011-05-20 Thread TheSaint
Miki Tebeka wrote: > The best module for doing such things is subprocess. And the Popen object > has a pid attribute I knew that, it's my fault that I'm not good to manage with popen. I found simplier to use subprocess.getstatusoutput. Maybe this function doesn't return the child pid, so I shou

Re: hash values and equality

2011-05-20 Thread MRAB
On 20/05/2011 07:33, Ulrich Eckhardt wrote: Ethan Furman wrote: Several folk have said that objects that compare equal must hash equal, and the docs also state this http://docs.python.org/dev/reference/datamodel.html#object.__hash__ I'm hoping somebody can tell me what horrible thing will happe

Re: hash values and equality

2011-05-20 Thread Chris Angelico
On Sat, May 21, 2011 at 1:50 AM, MRAB wrote: > [snip] > Is this strictly true? I thought that the hash value, an integer, is > moduloed (Is that how you spell it? Looks weird!) with the number of > array elements to give an index into the array, so different hashes > could give the same index, and

Re: obviscating python code for distribution

2011-05-20 Thread geremy condra
On Fri, May 20, 2011 at 12:10 AM, Steven D'Aprano wrote: > On Thu, 19 May 2011 17:56:12 -0700, geremy condra wrote: > >> TL;DR version: large systems have indeed been verified for their >> security properties. > > How confident are we that the verification software is sufficiently bug- > free that

Re: hash values and equality

2011-05-20 Thread Chris Kaynor
On Fri, May 20, 2011 at 9:20 AM, Chris Angelico wrote: > On Sat, May 21, 2011 at 1:50 AM, MRAB wrote: > > [snip] > > Is this strictly true? I thought that the hash value, an integer, is > > moduloed (Is that how you spell it? Looks weird!) with the number of > > array elements to give an index i

Why did Quora choose Python for its development?

2011-05-20 Thread Beliavsky
I thought this essay on why one startup chose Python was interesting. http://www.quora.com/Why-did-Quora-choose-Python-for-its-development PHP was out of the question. Facebook is stuck on that for legacy reasons, not because it's the best choice right now.[1] Our main takeaway from that experien

Re: Faster Recursive Fibonacci Numbers

2011-05-20 Thread Steven D'Aprano
On Fri, 20 May 2011 16:54:06 +1000, Chris Angelico wrote: > If someone has time to kill (as if!), it'd be awesome to get a new > numeric type that uses bc's code; any other numeric type (int, long, > float) could autopromote to it, removing the dilemma of which to promote > out of long and float.

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread rusi
On May 20, 1:48 pm, Hans Georg Schaathun wrote: > On 20 May 2011 06:55:35 GMT, Steven D'Aprano  > wrote: > > :  On Thu, 19 May 2011 22:13:14 -0700, rusi wrote: > : > : > [I agree with you Xah that recursion is a technical word that should not > : > be foisted onto lay users.] > : > :  I think th

Re: hash values and equality

2011-05-20 Thread Ethan Furman
Chris Rebert wrote: On Thu, May 19, 2011 at 10:43 PM, Ethan Furman wrote: Several folk have said that objects that compare equal must hash equal, and the docs also state this http://docs.python.org/dev/reference/datamodel.html#object.__hash__ I'm hoping somebody can tell me what horrible thing

Re: hash values and equality

2011-05-20 Thread Ethan Furman
Peter Otten wrote: Ethan Furman wrote: Several folk have said that objects that compare equal must hash equal, and the docs also state this http://docs.python.org/dev/reference/datamodel.html#object.__hash__ I'm hoping somebody can tell me what horrible thing will happen if this isn't the case

Re: obviscating python code for distribution

2011-05-20 Thread Nobody
On Fri, 20 May 2011 07:10:45 +, Steven D'Aprano wrote: > How confident are we that the verification software tests every possible > vulnerability, Formal verification is based upon mathematical proof, not empirical results. As Dijkstra said: "Program testing can be used to show the presence

List of WindowsError error codes and meanings

2011-05-20 Thread Andrew Berg
This is probably somewhat off-topic, but where would I find a list of what each error code in WindowsError means? WindowsError is so broad that it could be difficult to decide what to do in an except clause. Fortunately, sys.exc_info()[1][0] holds the specific error code, so I could put in an if...

Re: hash values and equality

2011-05-20 Thread Ian Kelly
On Fri, May 20, 2011 at 10:36 AM, Chris Kaynor wrote: > I think the question was: can this dummy code ever produce a set containing > less then itemCount items (for 0 < itemCount < 2**32)? In CPython, no. Even when you get a hash collision, the code checks to see whether the hashes are actually

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread GSO
On 20 May 2011 18:21, rusi wrote: > On May 20, 1:48 pm, Hans Georg Schaathun wrote: > > On 20 May 2011 06:55:35 GMT, Steven D'Aprano < > steve+comp.lang.pyt...@pearwood.info> wrote: > > > > : On Thu, 19 May 2011 22:13:14 -0700, rusi wrote: > > : > > : > [I agree with you Xah that recursion is

TK program problem

2011-05-20 Thread bvdp
I've just done an update to my system here to Ubuntu 11.04. Mostly no problems ... but I have an important (to me) python/TK program that's stopped working. Well, it works ... mostly. The python version is 2.7.1+ (no idea what the + means!). I _think_ I have traced the problem to certain menus wh

Re: hash values and equality

2011-05-20 Thread Ethan Furman
Ulrich Eckhardt wrote: Ethan Furman wrote: Several folk have said that objects that compare equal must hash equal, and the docs also state this http://docs.python.org/dev/reference/datamodel.html#object.__hash__ I'm hoping somebody can tell me what horrible thing will happen if this isn't the c

maybe useful : datetime conversion

2011-05-20 Thread Stef Mientki
hello, using datetimes from a lot of different sources, in many languages, I had about 30 python helper routines, which I now packed in one class, much simpler. Although I used the Delphi date-format as the base, it shouldn't be difficult to rewrite the class for another type. The input can be on

Re: hash values and equality

2011-05-20 Thread Ethan Furman
Ethan Furman wrote: Several folk have said that objects that compare equal must hash equal, and the docs also state this http://docs.python.org/dev/reference/datamodel.html#object.__hash__ Two things I didn't make clear originally: I'm using Python3. My objects (of type Wierd) obey the prem

Re: Faster Recursive Fibonacci Numbers

2011-05-20 Thread geremy condra
On Fri, May 20, 2011 at 10:07 AM, Steven D'Aprano wrote: > On Fri, 20 May 2011 16:54:06 +1000, Chris Angelico wrote: > >> If someone has time to kill (as if!), it'd be awesome to get a new >> numeric type that uses bc's code; any other numeric type (int, long, >> float) could autopromote to it, re

Re: hash values and equality

2011-05-20 Thread Chris Rebert
On Fri, May 20, 2011 at 10:56 AM, Ethan Furman wrote: > Chris Rebert wrote: >> On Thu, May 19, 2011 at 10:43 PM, Ethan Furman wrote: >>> Several folk have said that objects that compare equal must hash equal, >>> and >>> the docs also state this >>> http://docs.python.org/dev/reference/datamodel.

Re: hash values and equality

2011-05-20 Thread Christian Heimes
Am 20.05.2011 17:50, schrieb MRAB: > Is this strictly true? I thought that the hash value, an integer, is > moduloed (Is that how you spell it? Looks weird!) with the number of > array elements to give an index into the array, so different hashes > could give the same index, and objects with differ

ABC validation strictly on an instance

2011-05-20 Thread Eric Snow
The current ABC implementation in Python implies that the class of a conformant instance complies with the ABC. The implication does not carry down to the compliance of the instance itself. This means that if you inherit from an ABC that has an abstract property, your subclass must have a matchin

Re: TK program problem

2011-05-20 Thread Ian Kelly
On Fri, May 20, 2011 at 12:03 PM, bvdp wrote: > All this is fine (and worked perfectly before my upgrade). The menu > items which are ordinary functions continue to work. BUT the callbacks > which are classes are just ignored when they are clicked. I'm not a tk user, but it sounds like it has reg

Re: What other languages use the same data model as Python?

2011-05-20 Thread Albert van der Horst
In article , Chris Angelico wrote: >On Sat, May 7, 2011 at 7:21 PM, Gregory Ewing > wrote: >> Hans Georg Schaathun wrote: >> >>> You cannot reference nor manipulate a reference in python, and that IMHO >>> makes them more abstract. >> >> You can manipulate them just fine by moving them >> from on

Re: What other languages use the same data model as Python?

2011-05-20 Thread Albert van der Horst
In article <4dc7fa2f$0$29991$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: >On Mon, 09 May 2011 12:52:27 +1200, Gregory Ewing wrote: > >> Steven D'Aprano wrote: >> >>> Since you haven't explained what you think is happening, I can only >>> guess. >> >> Let me save you from guessing.

Re: List of WindowsError error codes and meanings

2011-05-20 Thread Genstein
On 20/05/2011 18:56, Andrew Berg wrote: This is probably somewhat off-topic, but where would I find a list of what each error code in WindowsError means? Assuming it's a Win32 error code, winerror.h from the Platform SDK holds the answer. One version is linked below, it's in theory out of date

Re: hash values and equality

2011-05-20 Thread MRAB
On 20/05/2011 20:01, Christian Heimes wrote: Am 20.05.2011 17:50, schrieb MRAB: Is this strictly true? I thought that the hash value, an integer, is moduloed (Is that how you spell it? Looks weird!) with the number of array elements to give an index into the array, so different hashes could give

Re: List of WindowsError error codes and meanings

2011-05-20 Thread Tim Golden
On 20/05/2011 18:56, Andrew Berg wrote: This is probably somewhat off-topic, but where would I find a list of what each error code in WindowsError means? WindowsError is so broad that it could be difficult to decide what to do in an except clause. Fortunately, sys.exc_info()[1][0] holds the speci

Re: hash values and equality

2011-05-20 Thread Peter Otten
Ethan Furman wrote: > Peter Otten wrote: >> Ethan Furman wrote: >> >>> Several folk have said that objects that compare equal must hash equal, >>> and the docs also state this >>> http://docs.python.org/dev/reference/datamodel.html#object.__hash__ >>> >>> I'm hoping somebody can tell me what horr

Re: obviscating python code for distribution

2011-05-20 Thread harrismh777
Steven D'Aprano wrote: Nonsense. How do you (generic "you", not any specific person) know that you are not an idiot? lol Sum, ergo Idiot cogitat. Reminds me of a philosophical story I heard one time from my religion professor... ... as it goes, De Carte leads his horse into town ;-)

Re: Why did Quora choose Python for its development?

2011-05-20 Thread Dotan Cohen
On Fri, May 20, 2011 at 19:39, Beliavsky wrote: > I thought this essay on why one startup chose Python was interesting. > > http://www.quora.com/Why-did-Quora-choose-Python-for-its-development > > PHP was out of the question. Facebook is stuck on that for legacy > reasons, not because it's the bes

Re: hash values and equality

2011-05-20 Thread Ethan Furman
Peter Otten wrote: Ethan Furman wrote: Peter Otten wrote: Ethan Furman wrote: Several folk have said that objects that compare equal must hash equal, and the docs also state this http://docs.python.org/dev/reference/datamodel.html#object.__hash__ --> class Wierd(): ... def __init__(self

Re: List of WindowsError error codes and meanings

2011-05-20 Thread Andrew Berg
On 2011.05.20 02:47 PM, Genstein wrote: > On 20/05/2011 18:56, Andrew Berg wrote: > > This is probably somewhat off-topic, but where would I find a list of > > what each error code in WindowsError means? > > Assuming it's a Win32 error code, winerror.h from the Platform SDK holds > the answer. One

Re: TK program problem

2011-05-20 Thread bvdp
> I'm not a tk user, but it sounds like it has regressed from accepting > arbitrary callables as callbacks to accepting functions specifically. > > What happens if you replace: > > ("Favorites", selectFav), > > with: > > ("Favorites", lambda: selectFav()), Okay, this works. Great and thanks! Seem

Re: TK program problem

2011-05-20 Thread Ian Kelly
On Fri, May 20, 2011 at 4:12 PM, bvdp wrote: > Okay, this works. Great and thanks! Seems to me that the way I was > doing it should be alright ... and I've got some other programs > exhibiting the same problem. > > Before I go "fixing" the issue ... is this known or even a bug? The docs [1] say t

Re: obviscating python code for distribution

2011-05-20 Thread geremy condra
On Fri, May 20, 2011 at 1:24 PM, harrismh777 wrote: > Steven D'Aprano wrote: >> >> Nonsense. How do you (generic "you", not any specific person) know that >> you are not an idiot? > > lol     Sum, ergo Idiot cogitat. > > > Reminds me of a philosophical story I heard one time from my religion > pro

Re: validating a class against an ABC at definition time

2011-05-20 Thread Eric Snow
On Thu, May 19, 2011 at 11:33 PM, Eric Snow wrote: > Thinking about class APIs and validating a class against an API. The abc > module provides the tools to do some of this. One thing I realized, that I > hadn't noticed before, is that the abstractness of a class is measured when > instances of

Re: TK program problem

2011-05-20 Thread bvdp
Probably the fix is to use a function :) > The docs [1] say that a callback is a function, so I guess that if it > worked before it was just luck.  You should bring it up on the tkinter > list and see what they have to say about it, though. > > I'm a bit confused about why you would want to use a

Re: TK program problem

2011-05-20 Thread Ian Kelly
On Fri, May 20, 2011 at 5:07 PM, bvdp wrote: > You mention the tkinter group. Ummm, what group is that??? http://tkinter.unpythonic.net/wiki/TkinterDiscuss -- http://mail.python.org/mailman/listinfo/python-list

Re: TK program problem

2011-05-20 Thread bvdp
On May 20, 4:29 pm, Ian Kelly wrote: > On Fri, May 20, 2011 at 5:07 PM, bvdp wrote: > > You mention the tkinter group. Ummm, what group is that??? > > http://tkinter.unpythonic.net/wiki/TkinterDiscuss Thanks. New one for me. I'll subscribe and see if they know about this. Best, -- http://mail.

Re: TK program problem

2011-05-20 Thread rantingrick
On May 20, 6:07 pm, bvdp wrote: > Probably the fix is to use a function :) > > > The docs [1] say that a callback is a function, so I guess that if it > > worked before it was just luck.  You should bring it up on the tkinter > > list and see what they have to say about it, though. > > > I'm a bit

Re: validating a class against an ABC at definition time

2011-05-20 Thread Eric Snow
On Fri, May 20, 2011 at 4:55 PM, Eric Snow wrote: > > I have revised this and made a recipe for it: > > > http://code.activestate.com/recipes/577711-validating-classes-and-objects-against-an-abstract/ > > I also added this: http://code.activestate.com/recipes/577712-adding-__implements__-to-subcl

Re: Faster Recursive Fibonacci Numbers

2011-05-20 Thread Chris Angelico
On Sat, May 21, 2011 at 3:07 AM, Steven D'Aprano wrote: > On Fri, 20 May 2011 16:54:06 +1000, Chris Angelico wrote: > >> If someone has time to kill (as if!), it'd be awesome to get a new >> numeric type that uses bc's code; any other numeric type (int, long, >> float) could autopromote to it, rem

Re: hash values and equality

2011-05-20 Thread Steven D'Aprano
On Fri, 20 May 2011 21:17:29 +0100, MRAB wrote: > On 20/05/2011 20:01, Christian Heimes wrote: >> Am 20.05.2011 17:50, schrieb MRAB: >>> Is this strictly true? I thought that the hash value, an integer, is >>> moduloed (Is that how you spell it? Looks weird!) ... >> >> I don't think 'moduloed' is

Python 2.6.7 release candidate 2 now available

2011-05-20 Thread Barry Warsaw
Hello to all you Pythoneers and Pythonistas, I'm happy to announce the availability of Python 2.6.7 release candidate 2. Release candidate 1 was not widely announced due to a mismatch between the Mercurial and Subversion branches. Barring any unforeseen issues, this will be the last release candi

Re: obviscating python code for distribution

2011-05-20 Thread Steven D'Aprano
On Fri, 20 May 2011 15:45:03 -0700, geremy condra wrote: > On Fri, May 20, 2011 at 1:24 PM, harrismh777 > wrote: >> ... as it goes, De Carte leads his horse into town   ;-)  and having >> hitched it to the rail outside the local saloon and sauntering up to >> the bar,  the tender asks, "Would yo

Re: hash values and equality

2011-05-20 Thread MRAB
On 21/05/2011 01:47, Steven D'Aprano wrote: On Fri, 20 May 2011 21:17:29 +0100, MRAB wrote: On 20/05/2011 20:01, Christian Heimes wrote: Am 20.05.2011 17:50, schrieb MRAB: Is this strictly true? I thought that the hash value, an integer, is moduloed (Is that how you spell it? Looks weird!) ..

Re: hash values and equality

2011-05-20 Thread Steven D'Aprano
On Sat, 21 May 2011 02:02:48 +0100, MRAB wrote: > On 21/05/2011 01:47, Steven D'Aprano wrote: >> On Fri, 20 May 2011 21:17:29 +0100, MRAB wrote: >> >>> On 20/05/2011 20:01, Christian Heimes wrote: Am 20.05.2011 17:50, schrieb MRAB: > Is this strictly true? I thought that the hash value, a

Re: Python 2.6.7 release candidate 2 now available

2011-05-20 Thread harrismh777
Barry Warsaw wrote: We will support Python 2.6 in security-fix only mode until October 2013. Where can I read about the criteria for security-fix only? Who decides whether the security fix is critical? thanks, kind regards, m harris -- http://mail.python.org/mailman/listinfo/python-list

Re: obviscating python code for distribution

2011-05-20 Thread harrismh777
Steven D'Aprano wrote: ... as it goes, De Carte leads his horse into town;-)and having >> hitched it to the rail outside the local saloon and sauntering up to >> the bar, the tender asks, "Would you be hav'in an ale sir?" >> >> ... De Carte replies, "I think not..." ... and then disap

Re: how to get PID from subprocess library

2011-05-20 Thread Kushal Kumaran
On Thu, May 19, 2011 at 9:32 PM, TheSaint wrote: > hello, > > I'm using to launch a program by subprocess.getstatusoutput. I'd like to > know whether I can get the program ID, in order to avoid another launch. > > For clarity sake, I'm calling aria2 (the download manager for linux) and I > wouldn'

Re: Overuse of try/except/else?

2011-05-20 Thread Cameron Simpson
On 11May2011 13:37, James Mills wrote: | On Tue, May 10, 2011 at 7:34 PM, Jean-Michel Pichavant | wrote: | > You can reraise the exception without loosing the stack trace. | > | > try: | > ... | > except SomeException, exc: | > log(exc) | > print 'Hello world' | > raise # "raise exc" would loose

Re: Python 2.6.7 release candidate 2 now available

2011-05-20 Thread Ned Deily
In article , harrismh777 wrote: > Barry Warsaw wrote: > > We will support Python 2.6 in security-fix only mode until > > October 2013. > Where can I read about the criteria for security-fix only? You can read about the Python development cycle and security branches in the Python Developer's