Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-11 Thread dieter
Thomas Güttler writes: > Am Donnerstag, 10. September 2015 08:42:47 UTC+2 schrieb dieter: >> Thomas Güttler writes: >> > ... >> > Why we are unhappy with logging to files: >> > >> > - filtering: We don't want to get INFO messages over the VPN. >> >> You can quite easily control at what level me

Re: Terminology: “reference” versus “pointer”

2015-09-11 Thread Chris Angelico
On Sat, Sep 12, 2015 at 4:26 PM, Ben Finney wrote: > If you do agree with those, some corollaries follow: > > * Container types do not contain objects. > > It is a useful analogy to say the objects are “in” the container; but > that would imply they are not simultaneously in any other containe

Re: Python handles globals badly.

2015-09-11 Thread Chris Angelico
On Sat, Sep 12, 2015 at 4:25 PM, Random832 wrote: > Chris Angelico writes: >> Here. Ned Batchelder explains it better than I can. > > See, those diagrams are perfect (well, almost, I think the names should > have square boxes too). They're arrows. They *point* at > things. *Pointers*. > > The box

Re: Terminology: “reference” versus “pointer”

2015-09-11 Thread Ben Finney
Random832 writes: > Ben Finney writes: > > The reference value is inaccessible to the program, it can only be > > used to get at the referenced object. > > What does it mean to access something, if not to do some operation on > it? Getting the referenced object is the operation you can do with i

Re: Python handles globals badly.

2015-09-11 Thread Random832
Chris Angelico writes: > Here. Ned Batchelder explains it better than I can. See, those diagrams are perfect (well, almost, I think the names should have square boxes too). They're arrows. They *point* at things. *Pointers*. The boxes are variables. The circles represent special boxes (implement

Re: Terminology: “reference” versus “pointer”

2015-09-11 Thread Random832
Mark Lawrence writes: > No it isn't. When you make a copy of an object you will end up with > two names that refer to the same object. No, when you *make a copy of* an object, you get two objects. >>> x = [1, 2, 3] >>> y = copy.copy(x) >>> x is y False What you make a copy of when you do y =

Re: Python handles globals badly.

2015-09-11 Thread Chris Angelico
On Sat, Sep 12, 2015 at 3:35 PM, Random832 wrote: > Mark Lawrence writes: >> Let's put it another way, in the 15 years I've been using Python I do >> not recall any experienced Python programmer using "pointer", so what >> makes you think, in 2015, that you are correct and everybody else is >> wr

Re: Terminology: “reference” versus “pointer”

2015-09-11 Thread Mark Lawrence
On 12/09/2015 06:42, Random832 wrote: Ben Finney writes: The reference value is inaccessible to the program, it can only be used to get at the referenced object. That's like saying an integer is inaccessible since it can only be used to add/subtract/etc (list of all operations you can do with

Re: Terminology: “reference” versus “pointer”

2015-09-11 Thread Chris Angelico
On Sat, Sep 12, 2015 at 3:03 PM, Random832 wrote: >> You can't, for example, keep the old reference (there are no references >> to references in Python), because they're not accessible as values in >> themselves. Once you assign a different reference, the old one is gone >> and can't be found agai

Re: Python handles globals badly.

2015-09-11 Thread Mark Lawrence
On 12/09/2015 06:35, Random832 wrote: Mark Lawrence writes: Let's put it another way, in the 15 years I've been using Python I do not recall any experienced Python programmer using "pointer", so what makes you think, in 2015, that you are correct and everybody else is wrong? I still say that e

Re: numpy

2015-09-11 Thread Miki Tebeka
On Thursday, September 10, 2015 at 1:11:59 PM UTC+3, chen...@inhand.com.cn wrote: > hi: > I have to use numpy package. My python runs on my embedded arm > device. So, how do i cross compile numpy? conda has support for ARM - http://continuum.io/blog/new-arch BTW: I suggest you write a better

Re: Terminology: “reference” versus “pointer”

2015-09-11 Thread Random832
Ben Finney writes: > The reference value is inaccessible to the program, it can only be used > to get at the referenced object. That's like saying an integer is inaccessible since it can only be used to add/subtract/etc (list of all operations you can do with an integer). What does it mean to acc

Re: Python handles globals badly.

2015-09-11 Thread Random832
Mark Lawrence writes: > Let's put it another way, in the 15 years I've been using Python I do > not recall any experienced Python programmer using "pointer", so what > makes you think, in 2015, that you are correct and everybody else is > wrong? I still say that everything in Python is an object,

Re: Python handles globals badly.

2015-09-11 Thread Mark Lawrence
On 12/09/2015 06:07, Random832 wrote: Mark Lawrence writes: How do I access these pointers? Is there a builtin called pointer() that's analogous to id()? You access them *all the time*. They are the *only* thing you access. But if you want... pointer = lambda x: return x I'll ask again, w

Re: Python handles globals badly.

2015-09-11 Thread Skybuck Flying
"Michael Torrie" wrote in message news:mailman.384.1442016089.8327.python-l...@python.org... On 09/11/2015 03:50 PM, Skybuck Flying wrote: Something which python does not seem to do currently ?! So that's weird. I will leave it at that for now. " Seems to me you have a completely mistak

Re: Terminology: “reference” versus “pointer”

2015-09-11 Thread Ben Finney
Random832 writes: > Ben Finney writes: > > > Random832 writes: > > > >> Ben Finney writes: > >> > With the significant difference that “pointer” implies that it has its > >> > own value accessible directly by the running program, such as a pointer > >> > in C. > >> > >> Its own value *is* what

Re: Python handles globals badly.

2015-09-11 Thread Random832
Mark Lawrence writes: > How do I access these pointers? Is there a builtin called pointer() > that's analogous to id()? You access them *all the time*. They are the *only* thing you access. But if you want... pointer = lambda x: return x > I'll ask again, where do pointers come into > the Jyth

Re: Terminology: “reference” versus “pointer”

2015-09-11 Thread Random832
Ben Finney writes: > Random832 writes: > >> Ben Finney writes: >> > With the significant difference that “pointer” implies that it has its >> > own value accessible directly by the running program, such as a pointer >> > in C. >> >> Its own value *is* what you're accessing when you assign or re

Re: Terminology: “reference” versus “pointer”

2015-09-11 Thread Ben Finney
Random832 writes: > Ben Finney writes: > > With the significant difference that “pointer” implies that it has its > > own value accessible directly by the running program, such as a pointer > > in C. > > Its own value *is* what you're accessing when you assign or return it. You're not describin

Re: Python handles globals badly.

2015-09-11 Thread Mark Lawrence
On 12/09/2015 05:34, Random832 wrote: Mark Lawrence writes: I think pointer is even worse because of its connection with C and hence cPython. What is wrong with object if that is the only thing Python knows about? Because the object is the *thing the arrow points at*. You don't have two obje

Re: Terminology: “reference” versus “pointer”

2015-09-11 Thread Random832
Ben Finney writes: > With the significant difference that “pointer” implies that it has its > own value accessible directly by the running program, such as a pointer > in C. Its own value *is* what you're accessing when you assign or return it. You just can't do math on it, but there are lots of

Re: Python handles globals badly.

2015-09-11 Thread Mark Lawrence
On 12/09/2015 05:11, Mario Figueiredo wrote: On 12-09-2015 03:35, Mark Lawrence wrote: Ada took over from CORAL in the UK, at least in military projects. It was also used in the aircraft industry. My old work mates tell me that its completely died a death, to be replaced by C++. Someone pleas

Re: Python handles globals badly.

2015-09-11 Thread Mark Lawrence
On 12/09/2015 05:16, Random832 wrote: Mark Lawrence writes: My favourite analogy for Python names, the sticky note, here https://mail.python.org/pipermail/tutor/2006-October/049767.html Is player3[3] also a sticky note? Wouldn't the note have to have the id of player3 written on it somehow? S

Re: Python handles globals badly.

2015-09-11 Thread Random832
Mark Lawrence writes: > I think pointer is even worse because of its connection with C and > hence cPython. What is wrong with object if that is the only thing > Python knows about? Because the object is the *thing the arrow points at*. You don't have two objects when store the same object in tw

Terminology: “reference” versus “pointer” (was: Python handles globals badly.)

2015-09-11 Thread Ben Finney
Random832 writes: > Honestly, whether you want to call the thing a pointer or a reference, > you have to call it *something*, and I think "reference" is a worse > fit based on its connotations from C++. Whatever you call it, it's an > arrow on a diagram. With the significant difference that “poi

Re: Python handles globals badly.

2015-09-11 Thread Mark Lawrence
On 12/09/2015 05:06, Random832 wrote: Mark Lawrence writes: On 12/09/2015 01:11, random...@fastmail.us wrote: If everything in Python is an object, how can it assign a pointer? Especially how do Jython and IronPython assign pointers? The Java and .NET runtimes also have pointers, they just d

Re: Python handles globals badly.

2015-09-11 Thread Random832
Mark Lawrence writes: > My favourite analogy for Python names, the sticky note, here > https://mail.python.org/pipermail/tutor/2006-October/049767.html Is player3[3] also a sticky note? Wouldn't the note have to have the id of player3 written on it somehow? Should the player3 sticky note have the

Re: Python handles globals badly.

2015-09-11 Thread Mario Figueiredo
On 12-09-2015 03:35, Mark Lawrence wrote: > > Ada took over from CORAL in the UK, at least in military projects. It > was also used in the aircraft industry. My old work mates tell me that > its completely died a death, to be replaced by C++. Someone please > remind me never to fly again. Alrigh

Re: Python handles globals badly.

2015-09-11 Thread Random832
Mark Lawrence writes: > On 12/09/2015 01:11, random...@fastmail.us wrote: > If everything in Python is an object, how can it assign a pointer? > Especially how do Jython and IronPython assign pointers? The Java and .NET runtimes also have pointers, they just don't [usually] call them pointers, j

Re: Python handles globals badly.

2015-09-11 Thread Steven D'Aprano
On Fri, 11 Sep 2015 05:28 pm, Antoon Pardon wrote: > Should C have chosen '<-' as token for assignment, that error > would have been far less common. > > The error is also facilitated because C doesn't have booleans > and so everything can be used as one. If C would have had > proper booleans [.

Re: Python handles globals badly.

2015-09-11 Thread Mark Lawrence
On 12/09/2015 01:01, Michael Torrie wrote: On 09/11/2015 03:50 PM, Skybuck Flying wrote: Something which python does not seem to do currently ?! So that's weird. I will leave it at that for now. Seems to me you have a completely mistaken understanding of how variables work in Python. This i

Re: Python handles globals badly.

2015-09-11 Thread Mark Lawrence
On 12/09/2015 01:11, random...@fastmail.us wrote: On Fri, Sep 11, 2015, at 20:01, Michael Torrie wrote: The secret to understanding the global keyword is to understand how Python namespaces work. The statement "a=5" does not assign a 5 to the box called "a." Rather it binds the name "a" to the

Re: Python handles globals badly.

2015-09-11 Thread Mark Lawrence
On 11/09/2015 09:42, Steven D'Aprano wrote: On Fri, 11 Sep 2015 10:35 am, Ian Kelly wrote: On Thu, Sep 10, 2015 at 4:25 PM, wrote: [...] So the compiler knows the distiction between global and local already. As we've said before, it doesn't. The compiler's current rules are fairly simple:

Re: Python handles globals badly.

2015-09-11 Thread Gene Heskett
On Friday 11 September 2015 22:35:00 Mark Lawrence wrote: > On 11/09/2015 03:19, Gene Heskett wrote: > > On Thursday 10 September 2015 20:33:03 Dennis Lee Bieber wrote: > >> On Thu, 10 Sep 2015 12:04:05 -0700 (PDT), rurpy--- via Python-list > >> > >> declaimed the following: > >>> I also doubt th

Re: Python handles globals badly.

2015-09-11 Thread Mark Lawrence
On 11/09/2015 06:15, Marko Rauhamaa wrote: Chris Angelico : Personally, I like to use tab characters for indentation. You can choose how many pixels or ems or ens or spaces the actual visual shift is, and if I disagree with your choice, it won't affect anything. As long as tabs are used _exclus

Re: Python handles globals badly.

2015-09-11 Thread Mark Lawrence
On 11/09/2015 03:19, Gene Heskett wrote: On Thursday 10 September 2015 20:33:03 Dennis Lee Bieber wrote: On Thu, 10 Sep 2015 12:04:05 -0700 (PDT), rurpy--- via Python-list declaimed the following: I also doubt there were more programming languages around in the 1970s than now, on the grounds

Re: Python handles globals badly.

2015-09-11 Thread Mark Lawrence
On 10/09/2015 23:25, t...@freenet.de wrote: Some notes to the "global"-keyword and the other proposals. It has been proposed to have these six enhancements 1. optional keyword "global" Won't happen. 2. switch statement Won't happen. 3. less restrictive indentation Won't happen. 4. u

Re: Context-aware return

2015-09-11 Thread Mark Lawrence
On 10/09/2015 18:54, Steven D'Aprano wrote: I have a function which is intended for use at the interactive interpreter, but may sometimes be used non-interactively. I wish to change it's output depending on the context of how it is being called. If the function is being called as if it were a pr

Re: monospaced font in MS Windows with wxpython

2015-09-11 Thread Javier
The font I posted before was actually monospaced. I was just putting the definition in the wrong place All solved now. Sorry for the noise. > txtctrl.SetFont(wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, > u'Consolas')) -- https://mail.python.org/mailman/listinfo/python-list

Re: Python handles globals badly.

2015-09-11 Thread Michael Torrie
On 09/11/2015 06:11 PM, random...@fastmail.us wrote: > On Fri, Sep 11, 2015, at 20:01, Michael Torrie wrote: >> The secret to understanding the global keyword is to understand how >> Python namespaces work. The statement "a=5" does not assign a 5 to the >> box called "a." Rather it binds the name

Re: Python handles globals badly.

2015-09-11 Thread random832
On Fri, Sep 11, 2015, at 20:01, Michael Torrie wrote: > The secret to understanding the global keyword is to understand how > Python namespaces work. The statement "a=5" does not assign a 5 to the > box called "a." Rather it binds the name "a" to the "5" object, which > is immutable and called in

Re: Python handles globals badly.

2015-09-11 Thread Michael Torrie
On 09/11/2015 03:50 PM, Skybuck Flying wrote: > Something which python does not seem to do currently ?! > > So that's weird. > > I will leave it at that for now. Seems to me you have a completely mistaken understanding of how variables work in Python. This is one of the reasons why I have said

Re: Signal SIGINT ignored during socket.accept

2015-09-11 Thread James Harris
"James Harris" wrote in message news:msv21t$n1m$1...@dont-email.me... "Grant Edwards" wrote in message news:msum6c$hv$1...@reader1.panix.com... ... Waking up twice per second and immediately calling select() again on any hardware/OS built in the past 50 years is going completely negligi

Re: Python handles globals badly.

2015-09-11 Thread MRAB
On 2015-09-11 22:26, t...@freenet.de wrote: Reflecting latest answers to global and "proposals" [snip] But you can say, the "general" sample is: You have to specify global that the compiler can distinguish between local and global Other words: global is needed to distinct global from local.

Re: monospaced font in MS Windows with wxpython

2015-09-11 Thread Emile van Sebille
On 9/11/2015 3:16 PM, Javier wrote: I am trying to use a monospaced font (preferably small) in MS Windows with wxpython. I have tried txtctrl.SetFont(wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, u'Consolas')) but no success, I still get a proportional font. You may also want to try

monospaced font in MS Windows with wxpython

2015-09-11 Thread Javier
I am trying to use a monospaced font (preferably small) in MS Windows with wxpython. I have tried txtctrl.SetFont(wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, u'Consolas')) but no success, I still get a proportional font. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python handles globals badly.

2015-09-11 Thread Ian Kelly
On Fri, Sep 11, 2015 at 3:26 PM, wrote: > Ad hominem. > There is a slogan: "There are always two persons involved" > This I dont want talk about. I dont go into such a discussion. > It seems more a problem of misinterpretations. I think you misunderstand my comment. The paragraph that I was resp

Re: Python handles globals badly.

2015-09-11 Thread Skybuck Flying
Hello, I'll add some arguments to the global discussion for you. First a look back at the origin of this "global" keyword, basically it's idea behind it, which is probably a flawed assumption. The origin/purpose of global as I now understand it is to give "write" access to globally declared

Re: Python handles globals badly.

2015-09-11 Thread tdev
Reflecting latest answers to global and "proposals" Ad hominem. There is a slogan: "There are always two persons involved" This I dont want talk about. I dont go into such a discussion. It seems more a problem of misinterpretations. Proofs. Not really proofs. I meant more or less proofs. Proo

Re: RPI.GPIO Help

2015-09-11 Thread hakugin . gin
On Friday, September 11, 2015 at 2:25:15 PM UTC-4, John McKenzie wrote: > Hello. > > Thanks to the help of people here and in other newsgroups I seem to have > something working doing the basics. (Buttons work, colours light up > appropriately.) > > When I followed MRAB's instructions and rea

Re: Problem with handling errors in POP3 message retrieval/deletion

2015-09-11 Thread Laura Creighton
In a message of Fri, 11 Sep 2015 17:33:32 +0100, c...@isbd.net writes: >I have a (fairly) simple script that does 'catchall' processing on my >POP3 mailbox. It looks for messages To: strings that *might* be for >me and then throws everything else away. Somebody tried to protect you from yourself.

CIVIL HERO & COMMODITIES, CURRENCIES, STOCKS GENIUS MICHELE NISTA micheleni...@gmx.com: HE GET IT RIGHT ON WORLDWIDE SECURITIES DE FACTO ALWAYS! BOUT 7320 PREDICTIONS SINCE AUGUST 1987 ( WHEN HE WAS +

2015-09-11 Thread PRINCIPAL OF MURDERS&SLAUGHTERS SILVIO BERLUSCONI!
CIVIL HERO & COMMODITIES, CURRENCIES, STOCKS GENIUS MICHELE NISTA micheleni...@gmx.com: HE GET IT RIGHT ON WORLDWIDE SECURITIES DE FACTO ALWAYS! BOUT 7320 PREDICTIONS SINCE AUGUST 1987 ( WHEN HE WAS +/- 20): 7320 SUCCESS! 100% SHOCKING WINNING SCORE! GENIUS, KING MIDAS, CIVIL HERO MICHELE NI

Re: RPI.GPIO Help

2015-09-11 Thread hakugin . gin
On Friday, September 11, 2015 at 2:25:15 PM UTC-4, John McKenzie wrote: > Hello. > > Thanks to the help of people here and in other newsgroups I seem to have > something working doing the basics. (Buttons work, colours light up > appropriately.) > def red_button(channel): > global colour

Re: RPI.GPIO Help

2015-09-11 Thread MRAB
On 2015-09-11 19:24, John McKenzie wrote: Hello. Thanks to the help of people here and in other newsgroups I seem to have something working doing the basics. (Buttons work, colours light up appropriately.) When I followed MRAB's instructions and read about scopes of variables that solved

Re: RPI.GPIO Help

2015-09-11 Thread John McKenzie
Hello. Thanks to the help of people here and in other newsgroups I seem to have something working doing the basics. (Buttons work, colours light up appropriately.) When I followed MRAB's instructions and read about scopes of variables that solved my most recent problem, but it introduced a

Re: Problem with handling errors in POP3 message retrieval/deletion

2015-09-11 Thread cl
c...@isbd.net wrote: > I have a (fairly) simple script that does 'catchall' processing on my > POP3 mailbox. It looks for messages To: strings that *might* be for > me and then throws everything else away. > [snip] Sorry folks, I found the problem, it's a known 'bug' due to someone trying to pro

Re: Signal SIGINT ignored during socket.accept

2015-09-11 Thread James Harris
"Grant Edwards" wrote in message news:msum6c$hv$1...@reader1.panix.com... On 2015-09-11, Chris Angelico wrote: This is what I meant when I said you would be polling. Effectively, you wake up your program every half-second, check if Ctrl-C has been pressed, and if it hasn't, you go back to s

Windows mingw64 compile pthon module error

2015-09-11 Thread Wannaphong
I using Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AM D64)] on win32. I install tdm64-gcc-5-1-0.exe. I setting from https://stackoverflow.com/a/27506457 , but I using "pip install scandir". C:\TDM-GCC-64\bin\x86_64-w64-mingw32-gcc.e

Problem with handling errors in POP3 message retrieval/deletion

2015-09-11 Thread cl
I have a (fairly) simple script that does 'catchall' processing on my POP3 mailbox. It looks for messages To: strings that *might* be for me and then throws everything else away. I was getting the occasional error as follows:- Traceback (most recent call last): File "/home/chris/.mutt/

Re: Python handles globals badly.

2015-09-11 Thread Ian Kelly
On Fri, Sep 11, 2015 at 10:04 AM, Chris Angelico wrote: > On Sat, Sep 12, 2015 at 1:57 AM, wrote: >> On Fri, Sep 11, 2015, at 11:55, Chris Angelico wrote: >>> On Sat, Sep 12, 2015 at 1:49 AM, Ian Kelly wrote: >>> > Ah, that makes sense. It's writing into the dict that is created and >>> > retur

Re: Python handles globals badly.

2015-09-11 Thread Rustom Mody
On Friday, September 11, 2015 at 9:27:46 PM UTC+5:30, rand...@fastmail.us wrote: > On Fri, Sep 11, 2015, at 11:55, Chris Angelico wrote: > > On Sat, Sep 12, 2015 at 1:49 AM, Ian Kelly wrote: > > > Ah, that makes sense. It's writing into the dict that is created and > > > returned by locals(), but

Re: Context-aware return

2015-09-11 Thread Rustom Mody
On Friday, September 11, 2015 at 12:53:28 AM UTC+5:30, Grant Edwards wrote: > On 2015-09-10, Steven D'Aprano wrote: > > > I have a function which is intended for use at the interactive interpreter, > > but may sometimes be used non-interactively. I wish to change it's output > > depending on the

Re: Python handles globals badly.

2015-09-11 Thread Chris Angelico
On Sat, Sep 12, 2015 at 1:57 AM, wrote: > On Fri, Sep 11, 2015, at 11:55, Chris Angelico wrote: >> On Sat, Sep 12, 2015 at 1:49 AM, Ian Kelly wrote: >> > Ah, that makes sense. It's writing into the dict that is created and >> > returned by locals(), but not actually updating the frame locals whi

Re: Context-aware return

2015-09-11 Thread Rustom Mody
On Friday, September 11, 2015 at 12:53:28 AM UTC+5:30, Grant Edwards wrote: > On 2015-09-10, Steven D'Aprano wrote: > > > I have a function which is intended for use at the interactive interpreter, > > but may sometimes be used non-interactively. I wish to change it's output > > depending on the

Re: Python handles globals badly.

2015-09-11 Thread random832
On Fri, Sep 11, 2015, at 11:55, Chris Angelico wrote: > On Sat, Sep 12, 2015 at 1:49 AM, Ian Kelly wrote: > > Ah, that makes sense. It's writing into the dict that is created and > > returned by locals(), but not actually updating the frame locals which > > are the source of truth. > > Yeah... bu

Re: Python handles globals badly.

2015-09-11 Thread Chris Angelico
On Sat, Sep 12, 2015 at 1:49 AM, Ian Kelly wrote: >> And that's the thing... I think. It's using locals(), which starts out >> as a copy of the function's locals (in this example, empty), but >> without assignment affecting anything. Which is more than a little >> weird: >> > def f(): >> ...

Re: Python handles globals badly.

2015-09-11 Thread Ian Kelly
On Fri, Sep 11, 2015 at 9:44 AM, Chris Angelico wrote: > On Sat, Sep 12, 2015 at 1:27 AM, Ian Kelly wrote: >> The exec still happily runs; it's just using its own private locals >> namespace. >> >> Tangent: does the help for exec need to be updated? It currently reads: >> >> The globals and

Re: Python handles globals badly.

2015-09-11 Thread Chris Angelico
On Sat, Sep 12, 2015 at 1:27 AM, Ian Kelly wrote: > The exec still happily runs; it's just using its own private locals namespace. > > Tangent: does the help for exec need to be updated? It currently reads: > > The globals and locals are dictionaries, defaulting to the current > globals an

Re: Python handles globals badly.

2015-09-11 Thread Ian Kelly
On Fri, Sep 11, 2015 at 9:15 AM, Chris Angelico wrote: > On Sat, Sep 12, 2015 at 1:03 AM, Ian Kelly wrote: >>> There's also a bunch of specialised and complicated rules for what happens >>> if you make a star import ("from module import *") inside a function, or >>> call eval or exec without spec

Re: Python handles globals badly.

2015-09-11 Thread Chris Angelico
On Sat, Sep 12, 2015 at 1:03 AM, Ian Kelly wrote: >> There's also a bunch of specialised and complicated rules for what happens >> if you make a star import ("from module import *") inside a function, or >> call eval or exec without specifying a namespace. Both of these things are >> now illegal i

Re: Python handles globals badly.

2015-09-11 Thread Ian Kelly
On Fri, Sep 11, 2015 at 2:42 AM, Steven D'Aprano wrote: > On Fri, 11 Sep 2015 10:35 am, Ian Kelly wrote: > >> On Thu, Sep 10, 2015 at 4:25 PM, wrote: > [...] >>> So the compiler knows the distiction between global and local already. >> >> As we've said before, it doesn't. The compiler's current

Re: Signal SIGINT ignored during socket.accept

2015-09-11 Thread Chris Angelico
On Fri, Sep 11, 2015 at 11:50 PM, Grant Edwards wrote: > On 2015-09-11, Chris Angelico wrote: > >> This is what I meant when I said you would be polling. Effectively, >> you wake up your program every half-second, check if Ctrl-C has been >> pressed, and if it hasn't, you go back to sleep again.

Re: Signal SIGINT ignored during socket.accept

2015-09-11 Thread Marko Rauhamaa
Grant Edwards : > On 2015-09-11, Chris Angelico wrote: >> This is what I meant when I said you would be polling. Effectively, >> you wake up your program every half-second, check if Ctrl-C has been >> pressed, and if it hasn't, you go back to sleep again. This is pretty >> inefficient. > > Though

Re: Signal SIGINT ignored during socket.accept

2015-09-11 Thread Grant Edwards
On 2015-09-11, Chris Angelico wrote: > This is what I meant when I said you would be polling. Effectively, > you wake up your program every half-second, check if Ctrl-C has been > pressed, and if it hasn't, you go back to sleep again. This is pretty > inefficient. Though it offends one's enginee

Re: subdividing a rectangle using numpy

2015-09-11 Thread Laura Creighton
I think pyeuclid will do what you want. https://pypi.python.org/pypi/euclid Laura -- https://mail.python.org/mailman/listinfo/python-list

Re: numpy

2015-09-11 Thread Laura Creighton
In a message of Fri, 11 Sep 2015 10:35:41 +0800, "chenc...@inhand.com.cn" write s: >hi, Laura: >My embedded arm device supports floating point operation. I >have to use numpy and pandas packages. But now, I do not known how to >cross compile numpy and pandas packages? You are going to h

Re: Python handles globals badly.

2015-09-11 Thread random832
On Fri, Sep 11, 2015, at 03:28, Antoon Pardon wrote: > The error is also facilitated because C doesn't have booleans > and so everything can be used as one. Python does have booleans and everything can be used as one - the logical conclusion is that being able to use everything as a boolean is a

Re: Python handles globals badly.

2015-09-11 Thread Marko Rauhamaa
Antoon Pardon : > I just don't get why people want to introduce special cases in python. > Why allow such a construct only in while and if? Why not just allow > it generally as an assignment expression? > > Why not allow: > > while (f(x) as fx) > 5: > proces(fx) > > or > > if check(nextval

Re: Python handles globals badly.

2015-09-11 Thread Antoon Pardon
Op 10-09-15 om 18:48 schreef Chris Angelico: > I'm not sure what the point would be of having an expression that > doesn't return a value. The point of assignment-as-an-expression is > that you can do other things with the result: > > while ((ch=getchar()) != EOF) > > In Python, we have a couple of

Re: Python handles globals badly.

2015-09-11 Thread Chris Angelico
On Fri, Sep 11, 2015 at 6:42 PM, Steven D'Aprano wrote: >>> Who is responding or has responded? >>> Extreme Programmers, Python-Hardliner, Python-Evangelists, ... . >>> Presumably no core Python Programmers (wrting compiler and standard >>> library stuff) >> >> Ad hominem. > > For the record, I am

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-11 Thread jmp
On 09/11/2015 09:22 AM, Thomas Güttler wrote: I want INFO to be logged and stored on the remote host. Therefore I must not filter INFO messages. I don't want to pull INFO messages over the VPN. Ergo, the filtering at Python level does not help in my use case. Or I am missing something. Proba

Re: Python handles globals badly.

2015-09-11 Thread Steven D'Aprano
On Fri, 11 Sep 2015 10:35 am, Ian Kelly wrote: > On Thu, Sep 10, 2015 at 4:25 PM, wrote: [...] >> So the compiler knows the distiction between global and local already. > > As we've said before, it doesn't. The compiler's current rules are > fairly simple: > > 1) If it's in the function's argu

Re: Python handles globals badly.

2015-09-11 Thread Skybuck Flying
"Random832" wrote in message news:mailman.242.1441758354.8327.python-l...@python.org... MRAB writes: If you're allowed to specify both bounds, why would you be forbidden from negative ones? " It makes it non-obvious what value should be returned from e.g. search methods that return a negati

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-11 Thread marco . nawijn
On Friday, September 11, 2015 at 9:22:42 AM UTC+2, Thomas Güttler wrote: > Am Donnerstag, 10. September 2015 08:42:47 UTC+2 schrieb dieter: > > Thomas Güttler writes: > > > ... > > > Why we are unhappy with logging to files: > > > > > > - filtering: We don't want to get INFO messages over the VPN.

Re: Python handles globals badly.

2015-09-11 Thread Rustom Mody
On Friday, September 11, 2015 at 10:04:25 AM UTC+5:30, Marko Rauhamaa wrote: > Ian Kelly : > > > You can use tabs *or* spaces. If you want to mix the two, then there > > would need to be some official decision made about how many spaces > > compose a tab, and then everybody who wants to use tabs w

Re: Python handles globals badly.

2015-09-11 Thread Antoon Pardon
Op 10-09-15 om 16:21 schreef Michael Torrie: > On 09/10/2015 01:27 AM, Antoon Pardon wrote: >> Op 09-09-15 om 19:55 schreef Steven D'Aprano: >>> In fairness to the C creators, I'm sure that nobody back in the early >>> seventies imagined that malware and security vulnerabilities would be as >>> wid

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-11 Thread Thomas Güttler
Am Donnerstag, 10. September 2015 08:42:47 UTC+2 schrieb dieter: > Thomas Güttler writes: > > ... > > Why we are unhappy with logging to files: > > > > - filtering: We don't want to get INFO messages over the VPN. > > You can quite easily control at what level messages are logged with > the stand

Re: finding the diff

2015-09-11 Thread Peter Otten
Noah wrote: > I am researching a nice slick way to provide the difference between > generated python multi-line configuration output and specific > configuration lines gathered from an output file. I could put things in > a list? I could put both forms output into IOString() and run a diff > co