Re: Recipe request: asyncio "spin off coroutine"

2016-12-15 Thread Frank Millman
"Marko Rauhamaa" wrote in message news:87mvfxirba@elektro.pacujo.net... It ain't over till the fat lady sings. Things can accumulate, hang and/or fail in surprising ways. At the very least you should maintain statistics that reveal the number of pending closing tasks for troubleshooting wh

Re: Name mangling vs qualified access to class attributes

2016-12-15 Thread Marco Paolieri
Hi all, Thank you for the feedback. So, to recap, reasons to use name mangling 'self.__update(iterable)' rather than qualified access 'Mapping.update(self, iterable)' are: 1. Qualified access stops working when class 'Mapping' is renamed (at compile-time) or its name is reassigned at runtime. H

Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.

2016-12-15 Thread skybuck2000
Hello, I received a reply from somebody on my ISP newsserver. Apperently his reply is not visible on google groups. I wonder why, maybe it's a banned troll or something, but perhaps not. Anyway... my ISP has problems accessing their newsserver. They won't offer the service to new customers or

[OT] "Invisible posts", was: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.

2016-12-15 Thread Peter Otten
skybuck2...@hotmail.com wrote: > I received a reply from somebody on my ISP newsserver. Apperently his > reply is not visible on google groups. I wonder why, maybe it's a banned > troll or something, but perhaps not. No, that's Dennis Lee Bieber who doesn't want his posts to be kept, and seems t

Re: Python3, column names from array - numpy or pandas

2016-12-15 Thread renjith madhavan
Thank you for the reply. I tried that, I am trying to do this. The context is I am trying to find mapk ( k = 3 ) for this list. A, B , C, D and E are product names. If I am trying manually I will do something like this. TRUTH = [[A], [B,C], [A], [D,E]] and if my prediction is : PRED=[[B,A, D],

Re: Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.

2016-12-15 Thread Random832
On Thu, Dec 15, 2016, at 08:31, Dennis Lee Bieber wrote: > As for my posts disappearing: I run with "X-NoArchive" set. I have from > before Google absorbed DejaNews. Back then, most news-servers expired > posts > on some periodic basis (my ISP tended to hold text groups for 30 days or > so, b

Unicode script

2016-12-15 Thread Steve D'Aprano
Suppose I have a Unicode character, and I want to determine the script or scripts it belongs to. For example: U+0033 DIGIT THREE "3" belongs to the script "COMMON"; U+0061 LATIN SMALL LETTER A "a" belongs to the script "LATIN"; U+03BE GREEK SMALL LETTER XI "ξ" belongs to the script "GREEK". Is

Problem running Python 3.5.2 on school network PC

2016-12-15 Thread Jed Mack
We are having a problem running Python 3.5.2 on Windows 10 x64 computers, which are members of a school network. The program seems to install correctly, but when we try to run the program it stops and give an error message saying: *Fatal Python error: Py_Initialize: unable to load the file sy

Re: Python constructors have particular semantics, and ‘Foo.__init__’ doesn't qualify

2016-12-15 Thread Thomas 'PointedEars' Lahn
Ben Finney wrote: > Chris Angelico writes: >> On Tue, Dec 13, 2016 at 10:17 AM, Ben Finney >> wrote: >> > If the differences didn't matter I would agree that “overly >> > pedantic” is fair. But those differences trip up newcomers. Thinking >> > of ‘Foo.__init__’ leads people to wonder where the

Re: Python3, column names from array - numpy or pandas

2016-12-15 Thread Rhodri James
On 15/12/16 01:56, renjith madhavan wrote: I have a dataset in the below format. id A B C D E 100 1 0 0 0 0 101 0 1 1 0 0 102 1 0 0 0 0 103 0 0 0 1 1 I wo

Mapping with continguous ranges of keys

2016-12-15 Thread Steve D'Aprano
I have some key:value data where the keys often are found in contiguous ranges with identical values. For example: {1: "foo", 2: "foo", 3: "foo", # same for keys 4 through 99 100: "foo", 101: "bar", 102: "bar", 103: "foobar", 104: "bar", 105: "foo", } So in this case, the keys 1 throug

Re: Mapping with continguous ranges of keys

2016-12-15 Thread D'Arcy Cain
On 2016-12-15 12:06 PM, Steve D'Aprano wrote: I have about a million or two keys, with a few hundred or perhaps a few thousand distinct values. The size of each contiguous group of keys with the same value can vary from 1 to perhaps a hundred or so. There isn't enough info in your post to be su

Re: Mapping with continguous ranges of keys

2016-12-15 Thread Thomas Nyberg
On 12/15/2016 09:06 AM, Steve D'Aprano wrote: Has anyone dealt with data like this and could give a recommendation of the right data structure to use? I haven't dealt with a data structure exactly like this, but it's basically a sparse array. (I'm sure it has a name somewhere in the academic

Re: Mapping with continguous ranges of keys

2016-12-15 Thread Peter Otten
Steve D'Aprano wrote: > I have some key:value data where the keys often are found in contiguous > ranges with identical values. For example: > > {1: "foo", > 2: "foo", > 3: "foo", > # same for keys 4 through 99 > 100: "foo", > 101: "bar", > 102: "bar", > 103: "foobar", > 104: "bar", > 10

Re: Unicode script

2016-12-15 Thread eryk sun
On Thu, Dec 15, 2016 at 4:53 PM, Steve D'Aprano wrote: > Suppose I have a Unicode character, and I want to determine the script or > scripts it belongs to. > > For example: > > U+0033 DIGIT THREE "3" belongs to the script "COMMON"; > U+0061 LATIN SMALL LETTER A "a" belongs to the script "LATIN"; >

Re: Unicode script

2016-12-15 Thread Joel Goldstick
I think this might be what you want: https://docs.python.org/3/howto/unicode.html#unicode-properties On Thu, Dec 15, 2016 at 11:53 AM, Steve D'Aprano wrote: > Suppose I have a Unicode character, and I want to determine the script or > scripts it belongs to. > > For example: > > U+0033 DIGIT THREE

Re: Unicode script

2016-12-15 Thread MRAB
On 2016-12-15 16:53, Steve D'Aprano wrote: Suppose I have a Unicode character, and I want to determine the script or scripts it belongs to. For example: U+0033 DIGIT THREE "3" belongs to the script "COMMON"; U+0061 LATIN SMALL LETTER A "a" belongs to the script "LATIN"; U+03BE GREEK SMALL LETTE

Re: Python constructors have particular semantics, and ‘Foo.__init__’ doesn't qualify

2016-12-15 Thread Terry Reedy
On 12/14/2016 11:14 PM, Thomas 'PointedEars' Lahn wrote: According to , “Foo.__init__” is _not_ an instance method. Were it an instance method, the following would not happen: This link points to subsection 9.3.4. Method Objects

Re: OT - "Soft" ESC key on the new MacBook Pro

2016-12-15 Thread Peter Pearson
On Wed, 14 Dec 2016 11:50:30 -0600, Skip Montanaro wrote: > On Wed, Dec 14, 2016 at 11:40 AM, Peter Pearson > wrote: >> Train your fingers to use C-[. > > As I recall, the location of the Ctrl key was one of the differences > between Sun and PC101 keyboards. Doesn't matter so much now, as Sun > has

Re: Problem running Python 3.5.2 on school network PC

2016-12-15 Thread Terry Reedy
On 12/15/2016 11:11 AM, Jed Mack wrote: We are having a problem running Python 3.5.2 on Windows 10 x64 computers, which are members of a school network. The program seems to install correctly, Is Python installed on each machine or on a network server? Rather precisely, how was Python installe

Re: Problem running Python 3.5.2 on school network PC

2016-12-15 Thread Tim Golden
On 15/12/2016 16:11, Jed Mack wrote: We are having a problem running Python 3.5.2 on Windows 10 x64 computers, which are members of a school network. The program seems to install correctly, but when we try to run the program it stops and give an error message saying: *Fatal Python error: Py_Ini

Reading python list as a newsgroup (was ...)

2016-12-15 Thread Terry Reedy
On 12/15/2016 6:23 AM, skybuck2...@hotmail.com wrote: Anyway... my ISP has problems accessing their newsserver. ... If you want to read python-list as a news group, you might try news.gmane.org. About once a year, it goes down for a few hours to a day, but has otherwise been dependable. I

Re: Problem running Python 3.5.2 on school network PC

2016-12-15 Thread Wildman via Python-list
On Thu, 15 Dec 2016 11:11:51 -0500, Jed Mack wrote: > We are having a problem running Python 3.5.2 on Windows 10 x64 computers, > which are members of a school network. > > > > The program seems to install correctly, but when we try to run the program > it stops and give an error message saying

Re: Python constructors have particular semantics, and ‘Foo.__init__’ doesn't qualify

2016-12-15 Thread Ian Kelly
On Thu, Dec 15, 2016 at 11:05 AM, Terry Reedy wrote: > On 12/14/2016 11:14 PM, Thomas 'PointedEars' Lahn wrote: > >> According to >> , >> “Foo.__init__” is _not_ an instance method. Were it an instance >> method, the following would

Re: Unicode script

2016-12-15 Thread Terry Reedy
On 12/15/2016 11:53 AM, Steve D'Aprano wrote: Suppose I have a Unicode character, and I want to determine the script or scripts it belongs to. For example: U+0033 DIGIT THREE "3" belongs to the script "COMMON"; U+0061 LATIN SMALL LETTER A "a" belongs to the script "LATIN"; U+03BE GREEK SMALL LE

A comparatively efficient software for embedding secret information bits into nataural language texts

2016-12-15 Thread Mok-Kong Shen
WORDLISTTEXTSTEGANOGRAPHY is a new software (employing an extensive English word list) which, while performing linguistic steganography, also involves pseudo-random separation of the word list into two sublists (for denoting 0 and 1 bits) that are dependent on dynamic session-key materials, thus

Re: Re: Install Problem

2016-12-15 Thread eryk sun
On Thu, Dec 15, 2016 at 8:24 PM, Rhesa Browning wrote: > I have not been able to find the temp folder. I am doing this on a work > computer > and don't have access to all the folders. Some are hidden. Enter %temp% in Explorer's location bar or the Win+R dialog. -- https://mail.python.org/mail

RE: Re: Install Problem

2016-12-15 Thread Rhesa Browning
Eryk sun. I have not been able to find the temp folder. I am doing this on a work computer and don't have access to all the folders. Some are hidden. -Original Message- From: eryk sun [mailto:eryk...@gmail.com] Sent: Tuesday, December 13, 2016 3:49 PM To: Python-list@python.org Cc: Rh

Re: Mapping with continguous ranges of keys

2016-12-15 Thread Terry Reedy
On 12/15/2016 12:06 PM, Steve D'Aprano wrote: I have some key:value data where the keys often are found in contiguous ranges with identical values. For example: {1: "foo", 2: "foo", 3: "foo", # same for keys 4 through 99 100: "foo", 101: "bar", 102: "bar", 103: "foobar", 104: "bar", 105

Re: Mapping with continguous ranges of keys

2016-12-15 Thread Terry Reedy
On 12/15/2016 12:27 PM, Thomas Nyberg wrote: On 12/15/2016 09:06 AM, Steve D'Aprano wrote: Has anyone dealt with data like this and could give a recommendation of the right data structure to use? I haven't dealt with a data structure exactly like this, but it's basically a sparse array. A s

Re: Python constructors have particular semantics, and ‘Foo.__init__’ doesn't qualify

2016-12-15 Thread Terry Reedy
On 12/15/2016 2:04 PM, Ian Kelly wrote: On Thu, Dec 15, 2016 at 11:05 AM, Terry Reedy wrote: On 12/14/2016 11:14 PM, Thomas 'PointedEars' Lahn wrote: According to , “Foo.__init__” is _not_ an instance method. Were it an instance

Re: Mapping with continguous ranges of keys

2016-12-15 Thread Thomas Nyberg
On 12/15/2016 12:48 PM, Terry Reedy wrote: On 12/15/2016 12:27 PM, Thomas Nyberg wrote: I haven't dealt with a data structure exactly like this, but it's basically a sparse array. A sparse array has at least half missing values. This one has none on the defined domain, but contiguous dupicat

Re: Unicode script

2016-12-15 Thread Terry Reedy
On 12/15/2016 1:06 PM, MRAB wrote: On 2016-12-15 16:53, Steve D'Aprano wrote: Suppose I have a Unicode character, and I want to determine the script or scripts it belongs to. For example: U+0033 DIGIT THREE "3" belongs to the script "COMMON"; U+0061 LATIN SMALL LETTER A "a" belongs to the scri

Re: Python constructors have particular semantics2c and ‘Foo.__init__’ doesn't qualify

2016-12-15 Thread Steve D'Aprano
On Fri, 16 Dec 2016 08:09 am, Terry Reedy wrote: > The __init__ function *is* an 'instance method', but not a (bound) > method object. The distinction is important. I admit that 'instance > method' can be confusing if one does not understand the contextual > meaning of the two words. A 'method'

Re: The right way to 'call' a class attribute inside the same class

2016-12-15 Thread Erik
On 13/12/16 06:14, Gregory Ewing wrote: Ned Batchelder wrote: if a C++ constructor raises an exception, will the corresponding destructor be run, or not? (No, because it never finished making an object of type T.) So it just leaks any memory that's been allocated by the partially-run construct

Re: The right way to 'call' a class attribute inside the same class

2016-12-15 Thread Erik
On 12/12/16 23:23, Chris Angelico wrote: In JavaScript, it's normal to talk about "calling a function as a constructor". When you do, there is a 'this' object before you start. No there isn't. There is an implicit binding of a variable called "this" based on the syntactic sugar of whether you'

Re: The right way to 'call' a class attribute inside the same class

2016-12-15 Thread Chris Angelico
On Fri, Dec 16, 2016 at 11:36 AM, Erik wrote: > On 12/12/16 23:23, Chris Angelico wrote: >> >> In JavaScript, it's normal to talk about "calling a function as a >> constructor". When you do, there is a 'this' object before you start. > > > No there isn't. There is an implicit binding of a variable

Re: Unicode script

2016-12-15 Thread MRAB
On 2016-12-15 21:57, Terry Reedy wrote: On 12/15/2016 1:06 PM, MRAB wrote: On 2016-12-15 16:53, Steve D'Aprano wrote: Suppose I have a Unicode character, and I want to determine the script or scripts it belongs to. For example: U+0033 DIGIT THREE "3" belongs to the script "COMMON"; U+0061 LAT

just started

2016-12-15 Thread metal . suomi
Hi everybody, I have just installed python 3.5.2 (downloaded from https://www.python.org/) on my mac (El Capitan). 1) I see from command line that older version of python are already available on my machine (python, python2.6, python2.7, python3, python3.5). I guess some might have been instal

Re: just started

2016-12-15 Thread Chris Angelico
On Fri, Dec 16, 2016 at 3:29 PM, wrote: > 2) if I wish to install extra libraries, in particularly SciPy, what's best > way of doing it? From command line I see the following commands: pip3 and > pip3.5. I guess pip3.5 is for python3.5 ? Can I use pip3 and pip3.5 > interchangeably, or pip3 wil

Re: A routine to calc Shannon's info entropy. I'm open to improvements/suggestions.

2016-12-15 Thread Steve D'Aprano
On Fri, 16 Dec 2016 09:21 am, DFS wrote: > Code is based on the formula and results here: > http://www.shannonentropy.netmark.pl [...] > Seems to work fine. > > Any suggestions to improve the code? - Separate the calculation logic from the display logic as much as practical. - Modular progra