socket: Did I find a bug?

2018-03-08 Thread Antoon Pardon
This is on a debian 9 box python 2.7.13 My interpretation is that a timeout exception is thrown and that the args attribute of such an exception is an empty tuple which then causes an IndexError in line 482 of module /usr/lib/python2.7/socket.py. Does that soundplausible? Here is the traceback:

Re: Which part of the loop is it going through in this class frame?

2018-03-08 Thread Steven D'Aprano
On Wed, 07 Mar 2018 16:57:51 -0500, C W wrote: > Hello, > > I am new to OOP. I'm a bit confused about the following code. > > class Clock(object): > def __init__(self, time): > self.time = time Here you set the instance attribute "self.time". > def print_time(self): > t

Re: socket: Did I find a bug?

2018-03-08 Thread INADA Naoki
https://mail.python.org/pipermail/python-list/2016-February/703154.html On Thu, Mar 8, 2018 at 8:09 PM, Antoon Pardon wrote: > This is on a debian 9 box python 2.7.13 > > My interpretation is that a timeout exception is thrown and that the > args attribute of such an exception is an empty tuple w

EuroPython 2018: Our conference logo

2018-03-08 Thread M.-A. Lemburg
After intense work with our designer, we are happy to present the logo for the EuroPython 2018 conference: https://blog.europython.eu/post/171656128512/europython-2018-our-conference-logo The colors and patterns are a play on Scottish kilts, referring to the location, and a theatre curtain, repre

EuroPython 2018: Hotel tips and general update

2018-03-08 Thread M.-A. Lemburg
As you may know, the Edinburgh Fringe Festival is starting one week after EuroPython 2018 in Edinburgh. Since this typically attracts many thousands of people and artists, the hotels are filling up quickly in Edinburgh. If you’re planning to attend EuroPython, please book your hotel early. Many bo

ANN: pygameweb 0.0.4 - Northern Rockhopper Penguin

2018-03-08 Thread René Dudfield
G'day. pygameweb is the source code for the pygame website at https://www.pygame.org/ [image: 6954251406_95ebe75f55_m] - #52

psychocomputational analysis toolkit in Python?

2018-03-08 Thread Etienne Robillard
Hi i want to develop a psychocomputational analysis toolkit in python for studying real-time neuroimaging data from focused ultrasound/brain-to-brain interfaces. Any suggestions where to look for cool projects in github? :) Best regards, Etienne -- Etienne Robillard tkad...@yandex.com htt

Re: psychocomputational analysis toolkit in Python?

2018-03-08 Thread Christopher Mullins
You might find MNE useful, and if what you're doing happens to fit somewhere in their package you could contribute to it -- they're a good group to work with. https://www.martinos.org/mne/stable/index.html https://github.com/mne-tools/mne-python -- https://mail.python.org/mailman/listinfo/python-

Re: psychocomputational analysis toolkit in Python?

2018-03-08 Thread Etienne Robillard
Thanks for sharing this link. MNE looks pretty cool. :-) I'm mostly interested in mapping specific cortical pathways to brain-to-brain interfaces implicated in the ultrasonic neuromodulation of behavior. Would it be possible to emulate a minimally functional brain-to-brain coupling system en

Re: psychocomputational analysis toolkit in Python?

2018-03-08 Thread Christopher Mullins
> Would it be possible to emulate a minimally functional brain-to-brain coupling system entirely in Python? I don't know what that would entail, but the links I shared have a mailing list and a very responsive gitter, both of which would be great places to ask about that! (You're welcome to ask h

Re: psychocomputational analysis toolkit in Python?

2018-03-08 Thread Bob Gailer
On Mar 8, 2018 10:08 AM, "Etienne Robillard" wrote: > > Thanks for sharing this link. MNE looks pretty cool. :-) > > I'm mostly interested in mapping specific cortical pathways to brain-to-brain interfaces implicated in the ultrasonic neuromodulation of behavior. > > Would it be possible to emulat

Re: psychocomputational analysis toolkit in Python?

2018-03-08 Thread Etienne Robillard
OK I got it, thank you! :) Essentially, I want to develop a psychocomputational analysis toolkit in Python for studying real-time neuroimaging data (of cortical activity) from low-intensity, focused ultrasounds (LIFU) and possibly emulate a functional brain-to-brain coupling system on my 32-bi

Unnoticed traceback in a thread

2018-03-08 Thread Skip Montanaro
I have a program which is almost always running in a single thread. It uses a daemon thread (via threading.Timer) to periodically checkpoint some state. The program runs for days at a time. Over the past couple days, two instances of the subthread croaked with tracebacks because while they were it

Spot the invalid syntax

2018-03-08 Thread Ian Pilcher
(Because I certainly can't.) def _san_dnsname_ips(dnsname, dnsname_is_cname=False): """ Returns a set of IP addresses, managed by this IPa instance, that correspond to the DNS name (from the subjectAltName). """ fqdn = dnsutil.DNSName(dnsname).make_absolute() if fqdn.__l

Re: Spot the invalid syntax

2018-03-08 Thread Chris Angelico
On Fri, Mar 9, 2018 at 10:23 AM, Ian Pilcher wrote: > (Because I certainly can't.) > >> ips.update(_san_dnsname_ips(cname, True) >> return ips > > > 2.7 and 3.6 are both giving me: > > File "/tmp/test.py", line 32 > return ips > ^ > SyntaxError: invalid syntax >

Re: Spot the invalid syntax

2018-03-08 Thread Ben Finney
Ian Pilcher writes: > > ips.update(_san_dnsname_ips(cname, True) > > return ips > > 2.7 and 3.6 are both giving me: > > File "/tmp/test.py", line 32 > return ips > ^ > SyntaxError: invalid syntax > > I've checked for tabs and mismatched parentheses. Not suffici

Re: Spot the invalid syntax

2018-03-08 Thread Ben Finney
Chris Angelico writes: > (Sometimes, you just need another pair of eyes.) In many cases, those eyes can be virtual and non-human. That's what syntax highlighting, and tools even more impressive (e.g. linting tools that run continually), offer in a programmer's text editor: a pair of eyes lookin

Re: Spot the invalid syntax

2018-03-08 Thread Chris Angelico
On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney wrote: > Chris Angelico writes: > >> (Sometimes, you just need another pair of eyes.) > > In many cases, those eyes can be virtual and non-human. > > That's what syntax highlighting, and tools even more impressive (e.g. > linting tools that run continua

Re: Spot the invalid syntax

2018-03-08 Thread Ben Finney
Chris Angelico writes: > On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney > wrote: > > In many cases, those eyes can be virtual and non-human. > > > > That's what syntax highlighting, and tools even more impressive > > (e.g. linting tools that run continually), offer in a programmer's > > text edito

Re: Spot the invalid syntax

2018-03-08 Thread Chris Angelico
On Fri, Mar 9, 2018 at 10:57 AM, Ben Finney wrote: > Chris Angelico writes: > >> On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney >> wrote: >> > In many cases, those eyes can be virtual and non-human. >> > >> > That's what syntax highlighting, and tools even more impressive >> > (e.g. linting tools

Re: Spot the invalid syntax

2018-03-08 Thread MRAB
On 2018-03-08 23:23, Ian Pilcher wrote: (Because I certainly can't.) def _san_dnsname_ips(dnsname, dnsname_is_cname=False): """ Returns a set of IP addresses, managed by this IPa instance, that correspond to the DNS name (from the subjectAltName). """ fqdn = dnsutil.DNSName

Re: Spot the invalid syntax

2018-03-08 Thread Terry Reedy
On 3/8/2018 6:30 PM, Ben Finney wrote: Ian Pilcher writes: ips.update(_san_dnsname_ips(cname, True) | <= auto-indent If you type this code line in IDLE or other decent Python-aware code editor, the smart indent would put curser where I put the

Re: Spot the invalid syntax

2018-03-08 Thread Bob van der Poel
On Thu, Mar 8, 2018 at 4:23 PM, Ian Pilcher wrote: > (Because I certainly can't.) > > def _san_dnsname_ips(dnsname, dnsname_is_cname=False): >> """ >> Returns a set of IP addresses, managed by this IPa instance, >> that correspond to the DNS name (from the subjectAltName). >> >> "

Re: Spot the invalid syntax

2018-03-08 Thread Ian Pilcher
On 03/08/2018 05:26 PM, Chris Angelico wrote: On Fri, Mar 9, 2018 at 10:23 AM, Ian Pilcher wrote: (Because I certainly can't.) ips.update(_san_dnsname_ips(cname, True) return ips I've checked for tabs and mismatched parentheses. Check the immediately preceding line (t

Re: Spot the invalid syntax

2018-03-08 Thread Ian Pilcher
On 03/08/2018 05:30 PM, Ben Finney wrote: Not sufficiently, it seems. Check the line preceding the ‘return’ statement. Indeed. :-/ Then, switch to using a programmer's text editor (I prefer Emacs) that can spot these syntax errors while you type. The sad thing is that I am. Just too bone-

Re: Spot the invalid syntax

2018-03-08 Thread MRAB
On 2018-03-08 23:57, Ben Finney wrote: Chris Angelico writes: On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney wrote: > In many cases, those eyes can be virtual and non-human. > > That's what syntax highlighting, and tools even more impressive > (e.g. linting tools that run continually), offer in

Re: Unnoticed traceback in a thread (Posting On Python-List Prohibited)

2018-03-08 Thread Rob Gaddi
On 03/08/2018 05:06 PM, Lawrence D’Oliveiro wrote: On Friday, March 9, 2018 at 11:43:00 AM UTC+13, Paul Rubin wrote: That you're using threading.Lock for something like this is a borderline code smell. Any use of multithreading in non-CPU-intensive code is a code smell. But CPU intensive co

Re: Which part of the loop is it going through in this class frame?

2018-03-08 Thread C W
Thank you guys, lots of great answers, very helpful. I got it! A follow-up question: How did the value of "object" get passed to "time"? Obviously, they have different names. How did Python make that connection? Code is below for convenience. class Clock(object): def __init__(self, time):

I am a student studying Python in Korea. I found strange thing while studying through idle

2018-03-08 Thread 노연수
If you type print (" hello\ rpython ") into the python 3.7.0.b2, only the python is printed and i learned it's a crystal. However, if you type print (" hello\ rpython ") in the python 3.7.0.b2 idle, it is output as hellopython. I wonder why it prints like this. I would appreciate your answer.

Relationship between ‘object’ and the name of an object (was: Which part of the loop is it going through in this class frame?)

2018-03-08 Thread Ben Finney
C W writes: > A follow-up question: (When you want to switch the discussion to a different subject, please indicate that by changing the Subject field in your message. I am not really clear on what you're asking, so I have guessed and made a subject that I think summarises what you mean.) > Ho

Re: Futurize maps StringIO.StringIO to io.StringIO

2018-03-08 Thread Mark Lawrence
On 08/03/18 02:34, Skip Montanaro wrote: I had some deja vu recently, cuz of this old thread: https://mail.python.org/pipermail/python-list/2013-May/648245.html Today the context is different, but the problem remains the same. One of the futurize refactoring tools converts usage of StringIO.Str

Re: I found strange thing while studying through idle

2018-03-08 Thread Ben Finney
Welcome, and congratulations on beginning with Python. 노연수 writes: > If you type print (" hello\ rpython ") into the python 3.7.0.b2 I am not using Python 3.7 (it isn't released yet); I recommend staying with the latest Python release. Today, that is version 3.6. That difference in version shou

Re: Futurize maps StringIO.StringIO to io.StringIO

2018-03-08 Thread Skip Montanaro
Thanks. In one instance I used six.StringIO, which seems to work. The question I had was more why futurize makes a transformation which is an obvious semantic change. Skip On Thu, Mar 8, 2018, 7:55 PM Mark Lawrence wrote: > On 08/03/18 02:34, Skip Montanaro wrote: > > I had some deja vu recentl

Re: I found strange thing while studying through idle

2018-03-08 Thread Steven D'Aprano
I'm afraid the original post by 노연수 has not come through to me, so I will have to reply to Ben's reply. On Fri, 09 Mar 2018 12:59:52 +1100, Ben Finney wrote: > I am not using Python 3.7 (it isn't released yet); I recommend staying > with the latest Python release. Today, that is version 3.6. 3

Re: I found strange thing while studying through idle

2018-03-08 Thread MRAB
On 2018-03-09 01:59, Ben Finney wrote: Welcome, and congratulations on beginning with Python. 노연수 writes: If you type print (" hello\ rpython ") into the python 3.7.0.b2 I am not using Python 3.7 (it isn't released yet); I recommend staying with the latest Python release. Today, that is vers

Re: I found strange thing while studying through idle

2018-03-08 Thread MRAB
On 2018-03-09 03:57, Steven D'Aprano wrote: [snip] In IDLE 3.5 on Linux, I get this: print('hello\rpython') hello\rpython Curiously, that's not a backslash r, it's actually a carriage return: when I copy and paste it in this text, the editor treated it as a new line character: # direct copy

Re: Spot the invalid syntax

2018-03-08 Thread Steven D'Aprano
On Fri, 09 Mar 2018 00:47:21 +, MRAB wrote: > On 2018-03-08 23:57, Ben Finney wrote: >> You mean the tool is not always looking for mistakes while you type? [...] >> Certainly it'd be good to always have a *perfect* overseer checking for >> mistakes . Until that happy day, though, let's use t

Re: Which part of the loop is it going through in this class frame?

2018-03-08 Thread Steven D'Aprano
On Thu, 08 Mar 2018 20:25:42 -0500, C W wrote: > Thank you guys, lots of great answers, very helpful. I got it! > > A follow-up question: > > How did the value of "object" get passed to "time"? Obviously, they have > different names. How did Python make that connection? It didn't. You have misu

Re: I found strange thing while studying through idle

2018-03-08 Thread Ben Finney
MRAB writes: > I think the line was actually […] > (I also think that "crystal" is […] Let's not get into the warrens of responding to what the OP *didn't* write. we're in no hurry. I'd like to wait for clarification from the original poster, and not guess what they meant. -- \ “The Vat

Re: Module Issue

2018-03-08 Thread dieter
Abdur-Rahmaan Janhangeer writes: > i have a project at > > https://github.com/Abdur-rahmaanJ/honeybot > > see https://github.com/Abdur-rahmaanJ/honeybot/tree/master/honeybot > > my question is : > > how to include a util file / module that can be imported in both > core_plugins and > user_plugins?

Re: socket: Did I find a bug?

2018-03-08 Thread dieter
Antoon Pardon writes: > This is on a debian 9 box python 2.7.13 > > My interpretation is that a timeout exception is thrown and that the > args attribute of such an exception is an empty tuple which then causes > an IndexError in line 482 of module /usr/lib/python2.7/socket.py. Does > that soundpl

Re: Unnoticed traceback in a thread

2018-03-08 Thread dieter
Skip Montanaro writes: > I have a program which is almost always running in a single thread. It > uses a daemon thread (via threading.Timer) to periodically checkpoint > some state. The program runs for days at a time. > > Over the past couple days, two instances of the subthread croaked with > t