Re: Assignment versus binding

2016-10-04 Thread Chris Angelico
On Wed, Oct 5, 2016 at 5:19 PM, Rustom Mody wrote: > Its ironical: > - Function in Fortran was meant to emulate math-functions > - C took the same thing and did a ‘small little syntax elision’ viz > conflating function and subprogram (procedure in Pascal speak) all under > the heading of function.

Re: Assignment versus binding

2016-10-04 Thread Chris Angelico
On Wed, Oct 5, 2016 at 5:17 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> Seriously though... this ties in with the other issues about *purely* >> functional languages being rather impractical, and the purity >> generally being sullied some by things like monads (which I still >> don't un

Re: Python 3.5 amd64 and win32service

2016-10-04 Thread eryk sun
On Wed, Oct 5, 2016 at 6:18 AM, Nagy László Zsolt wrote: > But again, that is not related to the question. Why does it not work? > What is missing? If you mean why running the service doesn't work, it should once you run the post-install script that copies pywintypes35.dll to the Windows System32

Re: Assignment versus binding

2016-10-04 Thread Rustom Mody
On Wednesday, October 5, 2016 at 11:34:31 AM UTC+5:30, Gregory Ewing wrote: > Steve D'Aprano wrote: > > > And (shamelessly using Python syntax) if I have a function: > > > > def spam(x): > > print(x) > > print(x+1) > > > > spam(time.sleep(60) or 1) > > You can't write that in Haskell,

Re: Assignment versus binding

2016-10-04 Thread Gregory Ewing
Chris Angelico wrote: Seriously though... this ties in with the other issues about *purely* functional languages being rather impractical, and the purity generally being sullied some by things like monads (which I still don't understand, despite the explanations in another thread). If you'd lik

Re: Python 3.5 amd64 and win32service

2016-10-04 Thread Nagy László Zsolt
>> def main(self): >> self.ReportServiceStatus(win32service.SERVICE_RUNNING) >> while not self.stop_requested.is_set(): >> time.sleep(1) # So something useful here > Why don't you use the Windows Event (hWaitStop) with > WaitForSingleObject instead of an additional

Re: Assignment versus binding

2016-10-04 Thread Gregory Ewing
Chris Angelico wrote: So what happens if you have a monad "print to the console" in place of Steve's time.sleep example? Will you get one execution of it or two? Again, you wouldn't be able to write it that way in Haskell. The things you *would* be able to write would all have the property tha

Re: Assignment versus binding

2016-10-04 Thread Gregory Ewing
Steve D'Aprano wrote: And (shamelessly using Python syntax) if I have a function: def spam(x): print(x) print(x+1) > > spam(time.sleep(60) or 1) You can't write that in Haskell, because Haskell's equivalent of print() is not a function (or at least it's not a function that ever return

Re: Assignment versus binding

2016-10-04 Thread Rustom Mody
On Wednesday, October 5, 2016 at 6:22:45 AM UTC+5:30, Steve D'Aprano wrote: > On Wed, 5 Oct 2016 04:12 am, Rustom Mody wrote: > > > On Tuesday, October 4, 2016 at 10:06:00 PM UTC+5:30, Steve D'Aprano wrote: > >> On Tue, 4 Oct 2016 09:32 pm, Rustom Mody wrote: > >> > >> > Are not the contents of t

Re: how to read linux kernel source with pycparser (Reposting On Python-List Prohibited)

2016-10-04 Thread meInvent bbird
yes, i searched in google between 2011 and 2012 descending for loop is faster than ascending for loop On Wednesday, October 5, 2016 at 9:48:41 AM UTC+8, Chris Angelico wrote: > On Wed, Oct 5, 2016 at 12:41 PM, meInvent bbird wrote: > > so far i do not know which bug i search for > > > > i would

Re: how to read linux kernel source with pycparser (Reposting On Python-List Prohibited)

2016-10-04 Thread Chris Angelico
On Wed, Oct 5, 2016 at 12:41 PM, meInvent bbird wrote: > so far i do not know which bug i search for > > i would like to change style of for loop > > form ascending to descending style > > for(int i=0; i<3; ++i) > > to > > for(int i=3; i>=0; --i) > > or > > most crazy to change if else if else int

Re: how to read linux kernel source with pycparser (Reposting On Python-List Prohibited)

2016-10-04 Thread meInvent bbird
On Wednesday, October 5, 2016 at 2:34:49 AM UTC+8, Lawrence D’Oliveiro wrote: > On Tuesday, October 4, 2016 at 10:38:14 PM UTC+13, meInvent bbird wrote: > > how to customize pycparser to search what we want such as bug > > What kind of bug do you want to search for? so far i do not know which bu

'str' object has no attribute 'intersection' and unhashable set

2016-10-04 Thread meInvent bbird
def consolidate(sets): # http://rosettacode.org/wiki/Set_consolidation#Python:_Iterative setlist = [s for s in sets if s] for i, s1 in enumerate(setlist): if s1: for s2 in setlist[i+1:]: intersection = s1.intersection(s2) if intersecti

Re: Assignment versus binding

2016-10-04 Thread Steve D'Aprano
On Wed, 5 Oct 2016 04:12 am, Rustom Mody wrote: > On Tuesday, October 4, 2016 at 10:06:00 PM UTC+5:30, Steve D'Aprano wrote: >> On Tue, 4 Oct 2016 09:32 pm, Rustom Mody wrote: >> >> > Are not the contents of the scope and the shape of the scope different >> > things? >> >> >> What does "the sha

Re: Assignment versus binding

2016-10-04 Thread Steve D'Aprano
On Wed, 5 Oct 2016 06:10 am, Marko Rauhamaa wrote: > Steve D'Aprano : > >> On Tue, 4 Oct 2016 11:27 pm, Ben Bacarisse wrote: >> >>> Haskell defines let (it's version of multiple mutually recursive >>> bindings) in terms of the least fix point of a lambda function whose >>> (pattern) parameter bin

Re: how to read linux kernel source with pycparser

2016-10-04 Thread Michael Torrie
On 10/04/2016 03:36 AM, meInvent bbird wrote: > i expect to use pycparser to read linux kernel source > and get a AST tree, > > but there are so many directory, > > how to read linux kernel source with pycparser? > > how to customize pycparser to search what we want such as bug or fix > to ma

Re: Assignment versus binding

2016-10-04 Thread Marko Rauhamaa
Ben Bacarisse : > The question came up because (I paraphrase) "even Scheme uses > assignment to explain mutually recursive definitions". Haskell defines > them using the fixed point operator. It's not really about Haskell > programs so much as how the language features are defined. BTW, here's the

Re: Assignment versus binding

2016-10-04 Thread Ben Bacarisse
Steve D'Aprano writes: > On Tue, 4 Oct 2016 11:27 pm, Ben Bacarisse wrote: > >> Haskell defines let (it's version of multiple mutually recursive >> bindings) in terms of the least fix point of a lambda function whose >> (pattern) parameter binds the expressions in the definitions. > > It binds *t

Re: Assignment versus binding

2016-10-04 Thread Chris Angelico
On Wed, Oct 5, 2016 at 6:10 AM, Marko Rauhamaa wrote: > A truly functional programming language wouldn't have side effects (in > this case, it wouldn't sleep). That makes sense. When people are sleeping, they're non-functional, ergo a programming language that can sleep is non-functional :) Seri

Re: Assignment versus binding

2016-10-04 Thread Marko Rauhamaa
Steve D'Aprano : > On Tue, 4 Oct 2016 11:27 pm, Ben Bacarisse wrote: > >> Haskell defines let (it's version of multiple mutually recursive >> bindings) in terms of the least fix point of a lambda function whose >> (pattern) parameter binds the expressions in the definitions. > > It binds *the expr

Re: rocket simulation game with just using tkinter

2016-10-04 Thread Irmen de Jong
On 4-10-2016 10:20, Christian Gollwitzer wrote: > Thanks! It works now with the cursor keys as intended. I'm still having > trouble, but > only because my game playing skills are not very good ;) Have you managed to land the rocket again at all after a takeoff? You can practice landing a bit by

Re: Assignment versus binding

2016-10-04 Thread Rustom Mody
On Tuesday, October 4, 2016 at 10:15:10 PM UTC+5:30, Steve D'Aprano wrote: > On Tue, 4 Oct 2016 11:27 pm, Ben Bacarisse wrote: > > > Haskell defines let (it's version of multiple mutually recursive > > bindings) in terms of the least fix point of a lambda function whose > > (pattern) parameter bin

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-04 Thread Albert-Jan Roskam
(Sorry for top-posting) Yep, part of the baby's hardware. Also, the interface is not limited to visual and auditory information: http://www.scientificamerican.com/article/pheromones-sex-lives/ From: Python-list on behalf of Steven D'Aprano Sent: Tuesday, Octob

Re: Assignment versus binding

2016-10-04 Thread Rustom Mody
On Tuesday, October 4, 2016 at 10:06:00 PM UTC+5:30, Steve D'Aprano wrote: > On Tue, 4 Oct 2016 09:32 pm, Rustom Mody wrote: > > > Are not the contents of the scope and the shape of the scope different > > things? > > > What does "the shape of the scope" mean? > > Scopes don't have a shape -- t

Re: Assignment versus binding

2016-10-04 Thread Steve D'Aprano
On Tue, 4 Oct 2016 11:27 pm, Ben Bacarisse wrote: > Haskell defines let (it's version of multiple mutually recursive > bindings) in terms of the least fix point of a lambda function whose > (pattern) parameter binds the expressions in the definitions. It binds *the expression* itself? Not the val

Testing POST in cherrypy

2016-10-04 Thread Israel Brewster
When testing CherryPy using a cherrypy.text.helper.CPWebCase subclass, I can test a page request by calling "self.getPage()", and in that call I can specify a method (GET/POST etc). When specifying a POST, how do I pass the parameters? I know for a POST the parameters are in the body of the requ

Thank you for the multipart/mixed

2016-10-04 Thread Jussi Piitulainen
Thank you, Python! I got important and urgent mail in a format that my rather-out-of-date Gnus (on a server that I don't control) failed to show me, except in its raw form. A search for tools to parse the raw multipart/mixed MIME formatted message, now in a file, turned out one promising thing: th

Re: Assignment versus binding

2016-10-04 Thread Steve D'Aprano
On Tue, 4 Oct 2016 09:32 pm, Rustom Mody wrote: > Are not the contents of the scope and the shape of the scope different > things? What does "the shape of the scope" mean? Scopes don't have a shape -- they aren't geometric objects. So I'm afraid I don't understand what distinction you are tryin

Re: Python 3.5 amd64 and win32service

2016-10-04 Thread eryk sun
On Tue, Oct 4, 2016 at 7:33 AM, Nagy László Zsolt wrote: > >>> Is it possible to write a win32 service with 64 bit python 3.5? The >>> pywin32 package does exist on 3.5 64bit, but missing some modules: >> Try pip installing the "pypiwin32" package. > That worked, thanks. > > Do you have an explana

Re: Assignment versus binding

2016-10-04 Thread Ben Bacarisse
Marko Rauhamaa writes: > dieter : >> The concept "assignment" comes from an operational semantics based on >> some form of "RAM" machine. Such a machine has storage cells where you >> can assign values to which remain there until overridden with a new >> value. >> >> The concept "binding" comes f

Re: lxml ignore none in getchildren

2016-10-04 Thread Peter Otten
Sayth Renshaw wrote: > I am following John Shipmans example from > http://infohost.nmt.edu/~shipman/soft/pylxml/web/Element-getchildren.html > xml = ''' > ... ''' pen = etree.fromstring(xml) penContents = pen.getchildren() for content in penContents: > ... print "%-10s %

Re: Assignment versus binding

2016-10-04 Thread Marko Rauhamaa
Rustom Mody : > You are scorning something basic: Dont like 'binding'? > Ok what about stack-frames? Activation-records? > > Just had a conversation with a colleague yesterday in which he was > complaining about how hard students find to learn this stuff because > of confusions like hardware-stack

lxml ignore none in getchildren

2016-10-04 Thread Sayth Renshaw
I am following John Shipmans example from http://infohost.nmt.edu/~shipman/soft/pylxml/web/Element-getchildren.html >>> xml = ''' ... ''' >>> pen = etree.fromstring(xml) >>> penContents = pen.getchildren() >>> for content in penContents: ... print "%-10s %3s" % (content.tag, content.get("n"

Re: Assignment versus binding

2016-10-04 Thread Rustom Mody
On Tuesday, October 4, 2016 at 2:05:31 PM UTC+5:30, Marko Rauhamaa wrote: > dieter : > > The concept "assignment" comes from an operational semantics based on > > some form of "RAM" machine. Such a machine has storage cells where you > > can assign values to which remain there until overridden with

Re: Assignment versus binding

2016-10-04 Thread Rustom Mody
On Tuesday, October 4, 2016 at 12:47:58 PM UTC+5:30, dieter wrote: > Steve D'Aprano writes: > > On Mon, 3 Oct 2016 04:15 pm, Jussi Piitulainen wrote: > >> Steve D'Aprano writes: > >>> Why shouldn't people say that binding and assignment are the same > >>> thing in Python? What's the difference? >

how to read linux kernel source with pycparser

2016-10-04 Thread meInvent bbird
i expect to use pycparser to read linux kernel source and get a AST tree, but there are so many directory, how to read linux kernel source with pycparser? how to customize pycparser to search what we want such as bug or fix to make a linux patch for linux kernel source with python? -- https

Re: Assignment versus binding

2016-10-04 Thread Marko Rauhamaa
dieter : > The concept "assignment" comes from an operational semantics based on > some form of "RAM" machine. Such a machine has storage cells where you > can assign values to which remain there until overridden with a new > value. > > The concept "binding" comes from a denotational semantics base

Re: rocket simulation game with just using tkinter

2016-10-04 Thread Christian Gollwitzer
Am 02.10.16 um 14:46 schrieb Irmen de Jong: On 1-10-2016 22:07, Irmen de Jong wrote: Oh, I'm sorry about that, my little knowledge of non-US keyboard layouts shows. Arrow keys could be an option. For my education what are the 2 keys to the right of the P then on your keyboard? Rebinding the

Re: PyQt5, OpenGL, where to start, minimal example code?

2016-10-04 Thread Phil Thompson
On 4 Oct 2016, at 5:57 am, John Ladasky wrote: > > On Monday, October 3, 2016 at 1:30:29 AM UTC-7, Phil Thompson wrote: >> On 3 Oct 2016, at 4:29 am, John Ladasky wrote: > >>> And as you can see: trying to call versionFunctions() is exactly where my >>> program failed. >> >> Try passing a QOp

Re: Python 3.5 amd64 and win32service

2016-10-04 Thread Nagy László Zsolt
>> Is it possible to write a win32 service with 64 bit python 3.5? The >> pywin32 package does exist on 3.5 64bit, but missing some modules: > Try pip installing the "pypiwin32" package. That worked, thanks. Do you have an explanation why to official build ( https://sourceforge.net/projects/pywi

Re: Assignment versus binding

2016-10-04 Thread dieter
Steve D'Aprano writes: > On Mon, 3 Oct 2016 04:15 pm, Jussi Piitulainen wrote: >> Steve D'Aprano writes: >>> Why shouldn't people say that binding and assignment are the same >>> thing in Python? What's the difference? >> >> Outside Python, (lambda x : f(x)) is said to "bind" x. It's different >>

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-04 Thread Steven D'Aprano
On Tuesday 04 October 2016 14:51, Michael Torrie wrote: > On 10/03/2016 08:21 PM, Steve D'Aprano wrote: >> On Tue, 4 Oct 2016 05:48 am, Michael Torrie wrote: >> >>> There is that old, but false, saying that the only intuitive interface >>> is the nipple. Turns out everything, even that, is learn