Re: Proposed keyword to transfer control to another function

2015-07-17 Thread Antoon Pardon
On 07/17/2015 01:46 AM, Chris Angelico wrote: > Open for bikeshedding: What should the keyword be? We can't use > "exec", which would match Unix and shell usage, because it's already > used in a rather different sense in Python. Current candidates: > "transfer", "goto", "recurse", and anything else

Re: A new module for performing tail-call elimination

2015-07-17 Thread Antoon Pardon
On 07/16/2015 09:34 PM, Terry Reedy wrote: > On 7/16/2015 3:45 AM, Antoon Pardon wrote: >> On 07/15/2015 11:19 PM, Terry Reedy wrote: >>> >>> I believe that this pattern should work with any set of mutually >>> recursive functions that always call each other in cyclic order. A >>> more elaborate v

Re: A new module for performing tail-call elimination

2015-07-17 Thread Robin Becker
On 16/07/2015 17:17, Ian Kelly wrote: On Thu, Jul 16, 2015 at 3:28 AM, Robin Becker wrote: . I believe the classic answer is Ackermann's function http://demonstrations.wolfram.com/RecursionInTheAckermannFunction/ which is said to be not "primitive recursive" ie cannot be un

Re: A new module for performing tail-call elimination

2015-07-17 Thread Antoon Pardon
On 07/16/2015 08:58 PM, Steven D'Aprano wrote: >> Nice of you to illustrate how being pedantic about something, can >> make a response useless with regard to the intended original question. > Just because your intention in giving that code was X, doesn't mean that > others cannot use that code to a

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Jean-Michel Pichavant
- Original Message - > From: "Steven D'Aprano" > 75% or 90% is not a "vast majority". Vast majority implies more than > 99%. You could not be more wrong. More than 99% is a stupendous majority, while within 95 to 99% is a tremendous majority. >From the official "Majority rating" 2015 ed

Re: Proposed keyword to transfer control to another function

2015-07-17 Thread Terry Reedy
On 7/17/2015 3:17 AM, Antoon Pardon wrote: On 07/17/2015 01:46 AM, Chris Angelico wrote: Open for bikeshedding: What should the keyword be? We can't use "exec", which would match Unix and shell usage, because it's already used in a rather different sense in Python. Current candidates: "transfer"

Re: Proposed keyword to transfer control to another function

2015-07-17 Thread Chris Angelico
On Fri, Jul 17, 2015 at 5:17 PM, Antoon Pardon wrote: > On 07/17/2015 01:46 AM, Chris Angelico wrote: >> Open for bikeshedding: What should the keyword be? We can't use >> "exec", which would match Unix and shell usage, because it's already >> used in a rather different sense in Python. Current ca

Re: Possibly Pythonic Tail Call Optimization (TCO/TRE)

2015-07-17 Thread Antoon Pardon
On 07/16/2015 06:43 PM, Chris Angelico wrote: > On Fri, Jul 17, 2015 at 12:32 AM, Antoon Pardon > wrote: > >> What is unclear about "as it is generally produced on stderr"? That you >> can do a whole lot of stuff, doesn't mean that this whole lot of stuff is >> part of what generally happens. When

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Chris Angelico
On Fri, Jul 17, 2015 at 4:47 PM, Steven D'Aprano wrote: >> Jessie's default should be 2.7, at least. Wheezy shipped 2.7, too; >> it's only Squeeze (now out of support) that didn't ship any 2.7.x >> Python. Are you sure you can't at least upgrade to 2.7? > > I'm not sure, I'm not actively involved

Re: Possibly Pythonic Tail Call Optimization (TCO/TRE)

2015-07-17 Thread Chris Angelico
On Fri, Jul 17, 2015 at 8:48 PM, Antoon Pardon wrote: > Just wondering, are traceback records of generators available? They are > if an exception is raised in the generator itself, but what if an exception > is raised in the loop that is driven by a generator. They don't appear in > the standard s

eGenix at the EuroPython Conference 2015

2015-07-17 Thread eGenix Team: M.-A. Lemburg
eGenix.com at the EuroPython Conference 2015 July 20-26 2015 Bilbao, Spain Meet up with eGenix at this year's EuroPython Conference in Bilbao.

Re: Possibly Pythonic Tail Call Optimization (TCO/TRE)

2015-07-17 Thread Antoon Pardon
On 07/17/2015 01:05 PM, Chris Angelico wrote: > On Fri, Jul 17, 2015 at 8:48 PM, Antoon Pardon > wrote: >> Just wondering, are traceback records of generators available? They are >> if an exception is raised in the generator itself, but what if an exception >> is raised in the loop that is driven

Re: Possibly Pythonic Tail Call Optimization (TCO/TRE)

2015-07-17 Thread Chris Angelico
On Fri, Jul 17, 2015 at 9:43 PM, Antoon Pardon wrote: > On 07/17/2015 01:05 PM, Chris Angelico wrote: >> On Fri, Jul 17, 2015 at 8:48 PM, Antoon Pardon >> wrote: >>> Just wondering, are traceback records of generators available? They are >>> if an exception is raised in the generator itself, but

Re: ANN: eGenix PyRun - One file Python Runtime 2.1.0

2015-07-17 Thread Alex
They don't offer any free versions for those systems and their licenses are quite expensive. On Fri, Jul 17, 2015 at 2:26 AM, Laura Creighton wrote: > I think Activestate makes a Python 2.y for Solaris. > http://www.activestate.com/activepython > > I've never used it. > > Laura > > In a message

Re: Possibly Pythonic Tail Call Optimization (TCO/TRE)

2015-07-17 Thread Antoon Pardon
On 07/17/2015 01:49 PM, Chris Angelico wrote: > On Fri, Jul 17, 2015 at 9:43 PM, Antoon Pardon > wrote: > > >> Sure, but in this case, the generator is still active. The Runtime >> would be able to jump to and somehow activates it's stack record >> for the next value. So why would we expect it to

Re: Possibly Pythonic Tail Call Optimization (TCO/TRE)

2015-07-17 Thread Chris Angelico
On Fri, Jul 17, 2015 at 10:54 PM, Antoon Pardon wrote: > On 07/17/2015 01:49 PM, Chris Angelico wrote: >> On Fri, Jul 17, 2015 at 9:43 PM, Antoon Pardon >> wrote: >> >> >>> Sure, but in this case, the generator is still active. The Runtime >>> would be able to jump to and somehow activates it's s

Re: How does a dictionary work exactly?

2015-07-17 Thread Ned Batchelder
On Thursday, July 16, 2015 at 2:59:02 PM UTC-4, Skip Montanaro wrote: > On Thu, Jul 16, 2015 at 1:36 PM, yoursurrogate...@gmail.com > wrote: > > If I understand correctly, lookup would not be a constant, yes? > > On the contrary, that's what you desire, nearly constant time > execution. To the gr

Re: ANN: eGenix PyRun - One file Python Runtime 2.1.0

2015-07-17 Thread M.-A. Lemburg
Hi Alex, On 17.07.2015 00:58, Alex wrote: > Do you have Python 2.7 64bit versions available for Solaris (10/11) > x86/SPARC, AIX, and HP-UX IA/RISC? I've had the displeasure of having to > install 64bit Python on Solaris and AIX and it's an experience I would not > recommend even though OpenCSW an

Re: How does a dictionary work exactly?

2015-07-17 Thread Skip Montanaro
On Fri, Jul 17, 2015 at 9:32 AM, Ned Batchelder wrote: > Maybe people are reading a different implementation than I am. Python's > dict object doesn't use linked lists to deal with hash collisions, it probes > other slots instead. No, I was working a) from memory, and b) not looking at the imple

Re: Need assistance

2015-07-17 Thread Rob Gaddi
On Thu, 16 Jul 2015 19:15:38 -0700, craig.sirna wrote: > I need help writing a homework program. > > I'll write it, but I can't figure out how to incorporate what I have > read in the book to work in code. > > The assignment wants us to take a users first, middle and last name in a > single inpu

Re: Need assistance

2015-07-17 Thread Igor Korot
Hi, Rob, On Fri, Jul 17, 2015 at 12:40 PM, Rob Gaddi wrote: > On Thu, 16 Jul 2015 19:15:38 -0700, craig.sirna wrote: > >> I need help writing a homework program. >> >> I'll write it, but I can't figure out how to incorporate what I have >> read in the book to work in code. >> >> The assignment w

Re: how do you play python because i have gone on the website but i haven't managed to code?

2015-07-17 Thread sohcahtoa82
On Thursday, July 16, 2015 at 12:31:04 PM UTC-7, Aron Barsam wrote: > how do you play python because i have gone on the website but i haven't > managed to code? http://i.imgur.com/x2KwTbw.jpg -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposed keyword to transfer control to another function

2015-07-17 Thread sohcahtoa82
On Friday, July 17, 2015 at 12:17:55 AM UTC-7, Antoon Pardon wrote: > On 07/17/2015 01:46 AM, Chris Angelico wrote: > > Open for bikeshedding: What should the keyword be? We can't use > > "exec", which would match Unix and shell usage, because it's already > > used in a rather different sense in Py

Re: Proposed keyword to transfer control to another function

2015-07-17 Thread Ethan Furman
On 07/17/2015 12:17 AM, Antoon Pardon wrote: On 07/17/2015 01:46 AM, Chris Angelico wrote: Open for bikeshedding: What should the keyword be? We can't use "exec", which would match Unix and shell usage, because it's already used in a rather different sense in Python. Current candidates: "transfe

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Rick Johnson
On Friday, July 17, 2015 at 1:38:52 AM UTC-5, Steven D'Aprano wrote: > 75% or 90% is not a "vast majority". Vast majority implies more than 99%. > > But regardless of the precise meaning of "vast", if you want to dismiss one > in four people (25%) or one in ten (10%) as inconsequential, then you'v

Need Help w. Getting the Eclipse Python Add-On.

2015-07-17 Thread Steve Burrus
I Need immediate Help w. Getting the Eclipse Python Add-On. I looked all around the Eclipse website to try to get this but didn't see the add-on for this. Can someone please help me to find it? Thanx. -- https://mail.python.org/mailman/listinfo/python-list

Re: Need Help w. Getting the Eclipse Python Add-On.

2015-07-17 Thread Jerry Hill
On Fri, Jul 17, 2015 at 2:22 PM, Steve Burrus wrote: > I Need immediate Help w. Getting the Eclipse Python Add-On. I looked all > around the Eclipse website to try to get this but didn't see the add-on for > this. Can someone please help me to find it? Thanx. I think you're looking for PyDev: h

Re: Need Help w. Getting the Eclipse Python Add-On.

2015-07-17 Thread Emile van Sebille
On 7/17/2015 11:22 AM, Steve Burrus wrote: I Need immediate Help w. Getting the Eclipse Python Add-On. I looked all around the Eclipse website to try to get this but didn't see the add-on for this. Can someone please help me to find it? Thanx. Googling 'python ecplise' certainly yields a lot

tkinter resize question

2015-07-17 Thread nickgeovanis
Resizing a tkinter window which contains a frame which contains a button widget, will not change the current size of the window, frame or button as recorded in their height and width attributes (at least not if they are resizable). What is the correct way to detect their current size? -- https:

Re: Need assistance

2015-07-17 Thread Mark Lawrence
On 17/07/2015 17:40, Rob Gaddi wrote: On Thu, 16 Jul 2015 19:15:38 -0700, craig.sirna wrote: I need help writing a homework program. I'll write it, but I can't figure out how to incorporate what I have read in the book to work in code. The assignment wants us to take a users first, middle and

Re: tkinter resize question

2015-07-17 Thread nickgeovanis
On Friday, July 17, 2015 at 1:53:19 PM UTC-5, nickge...@gmail.com wrote: > Resizing a tkinter window which contains a frame which contains a button > widget, will not change the current size of the window, frame or button as > recorded in their height and width attributes (at least not if they ar

Re: A new module for performing tail-call elimination

2015-07-17 Thread Terry Reedy
On 7/16/2015 3:45 PM, Marko Rauhamaa wrote: Nobody seemed to notice that I just posted a fairly typical tail call function: Because non-recursive tail calls are completely normal. Example: return len(self.children) Even tail operations like return a + b are tail calls if rewritten as

Re: tkinter resize question

2015-07-17 Thread Russell Owen
On 7/17/15 12:17 PM, nickgeova...@gmail.com wrote: On Friday, July 17, 2015 at 1:53:19 PM UTC-5, nickge...@gmail.com wrote: Resizing a tkinter window which contains a frame which contains a button widget, will not change the current size of the window, frame or button as recorded in their heig

Re: tkinter resize question

2015-07-17 Thread Rick Johnson
On Friday, July 17, 2015 at 2:52:56 PM UTC-5, Russell Owen wrote: > I'm not seeing it. If I try the following script I see > that resizing the widget does update frame.winfo_width() > and winfo_height. (I also see that the requested width and > height are ignored; you can omit those). I wonder if

Re: Possibly Pythonic Tail Call Optimization (TCO/TRE)

2015-07-17 Thread Terry Reedy
On 7/17/2015 7:43 AM, Antoon Pardon wrote: On 07/17/2015 01:05 PM, Chris Angelico wrote: def gen(): yield stuff yield more stuff for stuff in gen(): bomb with exception The error didn't happen in the generator, so I wouldn't expect to see it in the traceback. Yes something l

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Laura Creighton
I think kivy is doing a very nice job of python-on-the-mobile. Have you looked? Please do not rant at me, just tell me what you think. Laura -- https://mail.python.org/mailman/listinfo/python-list

Re: A new module for performing tail-call elimination

2015-07-17 Thread Marko Rauhamaa
Terry Reedy : > On 7/16/2015 3:45 PM, Marko Rauhamaa wrote: >> Nobody seemed to notice that I just posted a fairly typical tail call >> function: > > Because non-recursive tail calls are completely normal. I don't know how recursion makes a difference but that one did happen to be recursive. It c

Python Requirements

2015-07-17 Thread Luke Harrison
> Dear Python-List > > As part of my A2 Computing coursework, I need to program a solution using > Python 3.4. I also need to document the minimum requirements to run Python > 3.4 on a Windows machine, including minimum RAM, minimum processing power, > minimum hard disk space and monitor resolutio

Parsing and displaying C structs in a semi-intelligent way.

2015-07-17 Thread Anders Wegge Keller
In my day job, we have a large code base of mostly identical projects, each with their own customizations. The customizations can be a real pain sometimes. Especially when debugging binary data. The interesting part of the binary dumps are most often the stuff that are tweaked from project to proj

Re: Python Requirements

2015-07-17 Thread Chris Angelico
On Sat, Jul 18, 2015 at 7:37 AM, Luke Harrison wrote: > As part of my A2 Computing coursework, I need to program a solution using > > Python 3.4. I also need to document the minimum requirements to run Python > > 3.4 on a Windows machine, including minimum RAM, minimum processing power, > > minimu

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Mark Lawrence
On 17/07/2015 21:38, Laura Creighton wrote: I think kivy is doing a very nice job of python-on-the-mobile. Have you looked? Please do not rant at me, just tell me what you think. Laura At least rr occasionally comes out with something useful, usually WRT tkinter. He's in the bottom divisio

Re: tkinter resize question

2015-07-17 Thread nickgeovanis
On Friday, July 17, 2015 at 2:52:56 PM UTC-5, Russell Owen wrote: > On 7/17/15 12:17 PM, nickgeova...@gmail.com wrote: > > On Friday, July 17, 2015 at 1:53:19 PM UTC-5, nickge...@gmail.com wrote: > >> Resizing a tkinter window which contains a frame which contains a button > >> widget, will not ch

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Terry Reedy
On 7/17/2015 12:15 AM, Rick Johnson wrote: On Thursday, July 16, 2015 at 9:44:56 PM UTC-5, Steven D'Aprano wrote: [...] My take from all this is that overall, Python 3 take-up is probably > around 10% of all Python users, All that rambling just to agree with me? My educated guess is a minimum

Re: tkinter resize question

2015-07-17 Thread Terry Reedy
On 7/17/2015 2:53 PM, nickgeova...@gmail.com wrote: Resizing a tkinter window which contains a frame which contains a button widget, will not change the current size of the window, frame or button as recorded in their height and width attributes (at least not if they are resizable). Post the co

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Emile van Sebille
On 7/17/2015 3:45 PM, Terry Reedy wrote: Now my question for you or anyone else: If the vast majority of Python programmers are focused on 2.7, I consider myself in this group. why are volunteers to help fix 2.7 bugs so scarce? perhaps the bugs that are show stoppers are providing the impe

Re: Proposed keyword to transfer control to another function

2015-07-17 Thread Cameron Simpson
On 17Jul2015 20:43, Chris Angelico wrote: On Fri, Jul 17, 2015 at 5:17 PM, Antoon Pardon wrote: On 07/17/2015 01:46 AM, Chris Angelico wrote: Open for bikeshedding: What should the keyword be? We can't use "exec", which would match Unix and shell usage, because it's already used in a rather d

Re: A new module for performing tail-call elimination

2015-07-17 Thread Terry Reedy
On 7/17/2015 4:55 PM, Marko Rauhamaa wrote: Terry Reedy : On 7/16/2015 3:45 PM, Marko Rauhamaa wrote: Nobody seemed to notice that I just posted a fairly typical tail call function: Because non-recursive tail calls are completely normal. I don't know how recursion makes a difference Ther

Re: A new module for performing tail-call elimination

2015-07-17 Thread Chris Angelico
On Sat, Jul 18, 2015 at 10:40 AM, Terry Reedy wrote: > If children are not always instances of type(self), as when a tree has > separate Node and Leaf classes, then recursive calls to Node instances must > be separated from non-recursive Leaf calls before replacing the recursive > calls. More ser

Re: Need assistance

2015-07-17 Thread Denis McMahon
On Thu, 16 Jul 2015 19:15:38 -0700, craig.sirna wrote: > The assignment wants us to take a users first, middle and last name in a > single input ( name=('enter your full name: )). > > Then we must display the full name rearranged in Last, First Middle > order. To generate a list of words from a

Re: tkinter resize question

2015-07-17 Thread Terry Reedy
On 7/17/2015 6:42 PM, nickgeova...@gmail.com wrote: I don't think I've seen the "winfo_optioname()" construct in the python-side doc. For example Sec 25.1.6.1 "Setting Options" in the tkinter chapter of the standard python Library Reference doesn't mention it or anything syntactically similar.

Re: tkinter resize question

2015-07-17 Thread nickgeovanis
On Friday, July 17, 2015 at 5:55:19 PM UTC-5, Terry Reedy wrote: > On 7/17/2015 2:53 PM, nickgeova...@gmail.com wrote: > > Resizing a tkinter window which contains a frame which contains a > > button widget, will not change the current size of the window, frame > > or button as recorded in their he

Re: A new module for performing tail-call elimination

2015-07-17 Thread Paul Rubin
Chris Angelico writes: > My point was that I have yet to see anything that demands TCO and > can't be algorithmically improved. I don't think anyone claimed you can't simulate TCO with updateable variables and a while loop. TCO just sometimes lets you write some things in a cleaner (in proponnet

Re: Proposed keyword to transfer control to another function

2015-07-17 Thread Paul Rubin
Chris Angelico writes: > # derived from Paul Rubin's example > def quicksort(array, start, end): > midp = partition(array, start, end) Heh, forgot to include the base case, as someone pointed out. Oh well, it's pseudocode, or something. > transfer quicksort(array, midp+1, end) Ove

Re: Proposed keyword to transfer control to another function

2015-07-17 Thread Serhiy Storchaka
On 17.07.15 02:46, Chris Angelico wrote: Out of the lengthy thread on tail call optimization has come one broad theory that might be of interest, so I'm spinning it off into its own thread. The concept is like the Unix exec[vlpe] family of functions: replace the current stack frame with a new on

Re: tkinter resize question

2015-07-17 Thread Terry Reedy
On 7/17/2015 9:31 PM, nickgeova...@gmail.com wrote: On Friday, July 17, 2015 at 5:55:19 PM UTC-5, Terry Reedy wrote: On 7/17/2015 2:53 PM, nickgeova...@gmail.com wrote: Resizing a tkinter window which contains a frame which contains a button widget, will not change the current size of the windo