Re: Basic Nested Dictionary in a Loop

2017-04-03 Thread Peter Otten
Ganesh Pal wrote: >> >> >> Whenever you feel the urge to write range(len(whatever)) -- resist that >> temptation, and you'll end up with better Python code ;) >> >> > Thanks for this suggestion but for my better understanding can explain > this further even Steve did point the same mistake. It's

RE: Two variable dictionary comprehension

2017-04-03 Thread Deborah Swanson
Thanks Steve for writing this, and I'll read it more carefully when my illness gives my mind back to me. I was actually a math major before I discovered computer science, and I had to progress beyond machine language and assembler before I found the subtle differences and more flexible boundaries

RE: Two variable dictionary comprehension

2017-04-03 Thread Deborah Swanson
Gregory Ewing wrote, on Monday, April 03, 2017 4:23 PM > > Deborah Swanson wrote: > > I'd > > imagine that the old Google would have returned a good 10 pages or > > more (probably a lot more) of urls containing the phrase "dict > > comprehension" or "dictionary comprehension". > > It still does

RE: Two variable dictionary comprehension

2017-04-03 Thread Deborah Swanson
Gregory Ewing wrote, on Monday, April 03, 2017 4:23 PM > > Deborah Swanson wrote: > > All my guesses were based on the > > single variable (the most common type) examples I found. I just didn't > > think of putting a colon after 'label', and found nothing to suggest > > that's what I should do.

Re: Appending data to a json file

2017-04-03 Thread Oren Ben-Kiki
You _can_ just extend a JSON file without loading it, but it will not be "fun". Say the JSON file contains a top-level array. The final significant character in it would be a ']'. So, you can read just a reasonably-sized block from the end of the file, find the location of the final ']', overwrite

Re: Appending data to a json file

2017-04-03 Thread dieter
Dave writes: > I created a python program that gets data from a user, stores the data > as a dictionary in a list of dictionaries. When the program quits, it > saves the data file. My desire is to append the new data to the > existing data file as is done with purely text files. Usually, you c

Re: Obtain Ceritificate Information from Invalid or Self-Signed Certificate in Python

2017-04-03 Thread dieter
Kenneth Buckler writes: > I'm working on a Python 2.7.13 (Win x64) script to verify SSL certificates, > and alert for problems. Specifically, I'm looking to return the date the > cert expires or did expire. However, I'm running into an issue where the > script will return information only if the c

Version 2 of my natural language steganographical scheme released

2017-04-03 Thread Mok-Kong Shen
Version 2 of my natural language steganographical scheme WORDLISTTEXTSTEGANOGRAPHY is available on my home page http://mokkong-shen.privat.t-online.de , together with a few other cryptological and steganographical software of mine. See update notes in it for the differences to earlier versions

RE: Two variable dictionary comprehension

2017-04-03 Thread Deborah Swanson
Thank you Nate, for all these sources to study. Python was very easy for me to learn in 2 online courses, but it's been all uphill since then. I've learned a lot and for that I'm grateful, but there's so much farther to go. I've appreciated our discussions, but I am in fact a very sick person and

Re: Which directory should requests and openpyxl modules be installed to?

2017-04-03 Thread eryk sun
On Tue, Apr 4, 2017 at 1:45 AM, Dennis Lee Bieber wrote: > > C:\Users\Wulfraed>assoc .py > .py=Python.File > > C:\Users\Wulfraed>ftype python.file > python.file="C:\Python27\python.exe" "%1" %* The Windows shell stores the user file-association choice in HKCU\Software\Microsoft\Windows\CurrentVer

Re: Appending data to a json file

2017-04-03 Thread Michael Torrie
On 04/03/2017 08:59 PM, Dave wrote: > I created a python program that gets data from a user, stores the data > as a dictionary in a list of dictionaries. When the program quits, it > saves the data file. My desire is to append the new data to the > existing data file as is done with purely tex

Re: Two variable dictionary comprehension

2017-04-03 Thread Jerry Hill
On Mon, Apr 3, 2017 at 5:50 PM, Deborah Swanson wrote: > Ah, but did you actually try to use the proposed solutions on the two > stackoverflow pages? It's been several weeks now, but I did, and neither > of those two examples fit my situation, which is why I ended up writing > my own, and unsatisf

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-03 Thread Rick Johnson
On Sunday, April 2, 2017 at 3:49:43 PM UTC-5, Gene Heskett wrote: > On Sunday 02 April 2017 12:26:40 Steve D'Aprano wrote: > > On Sun, 2 Apr 2017 04:41 pm, Terry Reedy wrote: > > > On 4/1/2017 12:00 PM, Steve D'Aprano wrote: > > > > > > > > example of the Ugly American. > > > > > > As an American

Appending data to a json file

2017-04-03 Thread Dave
I created a python program that gets data from a user, stores the data as a dictionary in a list of dictionaries. When the program quits, it saves the data file. My desire is to append the new data to the existing data file as is done with purely text files. However, I can't find a way to do

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-03 Thread Chris Angelico
On Tue, Apr 4, 2017 at 10:13 AM, Rick Johnson wrote: > D'Aprano, are you still stewing because Donald J Trump > spanked Hillary's jumbo sized bottom like an unruly > stepchild? You poor widdle partisian hack. I almost feel > sorry for you. > > [snip massively long political rant] Alright, can the

Re: Two variable dictionary comprehension

2017-04-03 Thread Larry Martell
On Mon, Apr 3, 2017 at 8:24 PM Dennis Lee Bieber wrote: > On Mon, 3 Apr 2017 11:48:38 -0700, "Deborah Swanson" > declaimed the following: > > >But, if Larry Page and Sergey Brin could tinker around in their dorm > >rooms (or wherever they lived then) and they made the first Google (the > >first

RE: Two variable dictionary comprehension

2017-04-03 Thread Steve D'Aprano
On Tue, 4 Apr 2017 03:27 am, Deborah Swanson wrote: > I'll admit that both dictionaries and comprehensions are still a little > bit fuzzy to me, especially when I get away from the common usages. This > could be a good exercise to clarify some of the fuzzy areas. As far as comprehensions go, how

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-03 Thread Mark -
On Sunday, April 2, 2017 at 11:26:50 AM UTC-5, Steve D'Aprano wrote: On Sun, 2 Apr 2017 04:41 pm, Terry Reedy wrote: On 4/1/2017 12:00 PM, Steve D'Aprano wrote: example of the Ugly American. As an American I resent your promotion and perpetuation of an ugly ethno-centric stereotype. I'm

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-03 Thread Rick Johnson
On Sunday, April 2, 2017 at 11:26:50 AM UTC-5, Steve D'Aprano wrote: > On Sun, 2 Apr 2017 04:41 pm, Terry Reedy wrote: > > On 4/1/2017 12:00 PM, Steve D'Aprano wrote: > > > > > example of the Ugly American. > > > > As an American I resent your promotion and perpetuation of > > an ugly ethno-centr

Re: Which directory should requests and openpyxl modules be installed to?

2017-04-03 Thread Chris Angelico
On Tue, Apr 4, 2017 at 8:31 AM, wrote: > Hi Chris, > >Really! :) So I can type pip install requests at the prompt: C:\Program > Files\Python 2.7.12>pip install requests >or at C:\>pip install requests > >And the modules would be installed either way? > >Sorry I am also a newbie a

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-03 Thread Rick Johnson
On Saturday, April 1, 2017 at 9:32:17 PM UTC-5, MRAB wrote: > Sometimes he mentions MUDs, sometimes he mentions Pike, but at least he > doesn't rant. I have not even _begun_ to rant. Yet... -- https://mail.python.org/mailman/listinfo/python-list

Re: Two variable dictionary comprehension

2017-04-03 Thread Gregory Ewing
Deborah Swanson wrote: I'd imagine that the old Google would have returned a good 10 pages or more (probably a lot more) of urls containing the phrase "dict comprehension" or "dictionary comprehension". It still does, as far as I can see. I just googled for "dict comprehension", and the vast ma

Re: Two variable dictionary comprehension

2017-04-03 Thread Gregory Ewing
Deborah Swanson wrote: But, if Larry Page and Sergey Brin could tinker around in their dorm rooms (or wherever they lived then) and they made the first Google (the first search engine?) It wasn't the first web search engine. But it was the first one that not only worked, but *kept* working as

Re: Two variable dictionary comprehension

2017-04-03 Thread Gregory Ewing
Deborah Swanson wrote: All my guesses were based on the single variable (the most common type) examples I found. I just didn't think of putting a colon after 'label', and found nothing to suggest that's what I should do. Hmmm, I'm not sure what the docs could do to make that any clearer. The ke

Re: Two variable dictionary comprehension

2017-04-03 Thread Gregory Ewing
Deborah Swanson wrote: I'll admit that both dictionaries and comprehensions are still a little bit fuzzy to me, especially when I get away from the common usages. This could be a good exercise to clarify some of the fuzzy areas. If you're fuzzy about dictionaries in general, it might be a good

Re: Two variable dictionary comprehension

2017-04-03 Thread Nathan Ernst
No worries, Deborah. Python is by most measurements a relatively easy/simple language to learn, but there are always the dusty corners. If you've not already, I recommend going through the online Python tutorial in it's entirety ( https://docs.python.org/3/tutorial/index.html). After that, learn

Re: Which directory should requests and openpyxl modules be installed to?

2017-04-03 Thread psmith36
On Monday, April 3, 2017 at 2:02:30 PM UTC-7, Pauline wrote: > Hi, > > I am a newbie to Python. I am using Python 2.7.12. I want to install the > modules of requests and openpyxl using pip. In the Internet, people only > said pip install requests, but they do not say in which directory. I

Re: Which directory should requests and openpyxl modules be installed to?

2017-04-03 Thread Nathan Ernst
Hi Pauline, I was able to infer you're on Windows, but not which version. Try right-clicking on the start menu to start a command prompt as an administrator (I'm not sure that was available in Windows 7, and I don't have access to a Win7 box currently to verify). Failing that, you should be able t

Re: Which directory should requests and openpyxl modules be installed to?

2017-04-03 Thread Chris Angelico
On Tue, Apr 4, 2017 at 8:14 AM, wrote: > Hi Nate, > > Well, I didn't tell you I am on Windows 7. When I went to cmd, it was > C:\Users\myname. Then I navigated to where my Python was installed C:\Program > Files\Python 2.7.12> > > Do I type pip install requests at the end of the arrow, or

Re: Which directory should requests and openpyxl modules be installed to?

2017-04-03 Thread psmith36
On Monday, April 3, 2017 at 2:02:30 PM UTC-7, Pauline wrote: > Hi, > > I am a newbie to Python. I am using Python 2.7.12. I want to install the > modules of requests and openpyxl using pip. In the Internet, people only > said pip install requests, but they do not say in which directory. I

RE: Two variable dictionary comprehension

2017-04-03 Thread Deborah Swanson
Nathan Ernst wrote, on April 03, 2017 1:59 PM > > I was a bit surprised when I looked at the language reference > for 3.6.x. I expected there'd be a direct link to > comprehensions, but there's not. > > You have to know what you're looking for: > > 6.2.5: List Displays > 6.2.6: Set Displays >

Re: Which directory should requests and openpyxl modules be installed to?

2017-04-03 Thread Nathan Ernst
If you've installed into Program Files, then you're on Windows, and you've installed for all users. Start a command prompt by right-clicking on the start icon, then selecting "Command Prompt (Admin)". This should work on Windows 8.x and Windows 10. Windows 7, you may need to navigate through Progra

RE: Two variable dictionary comprehension

2017-04-03 Thread Deborah Swanson
Jerry Hill wrote, on April 03, 2017 1:48 PM > > On Mon, Apr 3, 2017 at 10:30 AM, Deborah Swanson > wrote: > > Regular updates as the docs are updated would be a good > idea too. It's > > obvious that today's Google isn't up to it, although it > occurs to me > > that I haven't tried Google's

Re: Which directory should requests and openpyxl modules be installed to?

2017-04-03 Thread psmith36
On Monday, April 3, 2017 at 2:02:30 PM UTC-7, Pauline wrote: > Hi, > > I am a newbie to Python. I am using Python 2.7.12. I want to install the > modules of requests and openpyxl using pip. In the Internet, people only > said pip install requests, but they do not say in which directory. I

Re: Which directory should requests and openpyxl modules be installed to?

2017-04-03 Thread Nathan Ernst
Hi Pauline, It depends largely on whether you want to (and have sufficient permissions) to install for all users or just yourself. If, on *nix, you're installing site-wide (for all users), typically you'd do: "sudo pip install " (for python 2) or "sudo pip3 install " (for python 3). If you're in

Which directory should requests and openpyxl modules be installed to?

2017-04-03 Thread Pauline
Hi, I am a newbie to Python. I am using Python 2.7.12. I want to install the modules of requests and openpyxl using pip. In the Internet, people only said pip install requests, but they do not say in which directory. I only found one that said install in the script directory within Pytho

Re: Two variable dictionary comprehension

2017-04-03 Thread Nathan Ernst
I was a bit surprised when I looked at the language reference for 3.6.x. I expected there'd be a direct link to comprehensions, but there's not. You have to know what you're looking for: 6.2.5: List Displays 6.2.6: Set Displays 6.2.7: Dictionary Displays And, then, click on the appropriate eleme

Re: Two variable dictionary comprehension

2017-04-03 Thread Jerry Hill
On Mon, Apr 3, 2017 at 10:30 AM, Deborah Swanson wrote: > Regular updates as the docs are updated would be a good idea too. It's > obvious that today's Google isn't up to it, although it occurs to me > that I haven't tried Google's site search on python.org. So, when you search google for the phr

Request Help With pkexec

2017-04-03 Thread Wildman via Python-list
Python 3.4.2 Tkinter 8.6 GCC 4.9.1 on Linux I am working on a gui program using Tkinter. The program will have a feature to restart as root. I am testing different gui front-ends from a terminal to raise privileges and I want to be able to use as many as possible for obvious reasons. Gksu, kdesu

RE: Two variable dictionary comprehension

2017-04-03 Thread Deborah Swanson
Rob Gaddi wrote, on April 03, 2017 10:38 AM > > On 04/03/2017 10:27 AM, Deborah Swanson wrote: > > Dennis Lee Bieber wrote, on April 03, 2017 9:35 AM > >> > >> On Mon, 3 Apr 2017 07:30:40 -0700, "Deborah Swanson" > >> declaimed the following: > >> > >>> > >>> Clearly there's more to be found in

OFF-TOPIC Bigotry on the list [was Re: Text-mode apps (Was :Who are the "spacists"?)]

2017-04-03 Thread Steve D'Aprano
On Mon, 3 Apr 2017 08:31 am, Terry Reedy wrote: [...] > I refrained because it would be off-topic and a diversion from my point: > all bigotry is inappropriate here on this list, Indeed it is not appropriate. But calling out bigotry is not itself bigotry. I hope you agree with that. If not, th

Re: Two variable dictionary comprehension

2017-04-03 Thread Rob Gaddi
On 04/03/2017 10:27 AM, Deborah Swanson wrote: Dennis Lee Bieber wrote, on April 03, 2017 9:35 AM On Mon, 3 Apr 2017 07:30:40 -0700, "Deborah Swanson" declaimed the following: Clearly there's more to be found in nooks, crannies and byways in the docs than you'll get to from the given poin

RE: Two variable dictionary comprehension

2017-04-03 Thread Deborah Swanson
Dennis Lee Bieber wrote, on April 03, 2017 9:35 AM > > On Mon, 3 Apr 2017 07:30:40 -0700, "Deborah Swanson" > declaimed the following: > > > > >Clearly there's more to be found in nooks, crannies and > byways in the > >docs than you'll get to from the given pointers in the > index. Maybe it

Re: Improve Python + Influxdb import performance

2017-04-03 Thread Prathamesh
On Monday, April 3, 2017 at 9:52:38 PM UTC+5:30, INADA Naoki wrote: > You can reuse connection, instead of creating for each request. (HTTP > keep-alive). > > On Tue, Apr 4, 2017 at 1:11 AM, Prathamesh > wrote: > > Hello World > > > > The following script is an extract from > > > > https://githu

Re: Behavior of auto in Enum and Flag.

2017-04-03 Thread Oren Ben-Kiki
On Mon, Apr 3, 2017 at 7:43 PM, Chris Angelico wrote: > Here's a counter-example that supports the current behaviour: > > >>> from enum import IntFlag, auto > >>> class Spam(IntFlag): > ... FOO = auto() > ... BAR = auto() > ... FOOBAR = FOO | BAR > ... SPAM = auto() > ... HAM

Re: Behavior of auto in Enum and Flag.

2017-04-03 Thread Chris Angelico
On Tue, Apr 4, 2017 at 2:29 AM, Ethan Furman wrote: > It this point I do not. If you can give us an example Enum and why it's > necessary to be built like that I might be swayed -- although the odds are > good that the change will go into aenum instead (it's already a mess with > the 2.7 compatib

Re: Behavior of auto in Enum and Flag.

2017-04-03 Thread Ethan Furman
On 04/03/2017 01:53 AM, Oren Ben-Kiki wrote: On Mon, Apr 3, 2017 at 11:03 AM, Ethan Furman wrote: Python code is executed top-down. First FOO, then BAR, then BAZ. It is not saved up and executed later in random order. Or, put another way, the value was appropriate when it was chosen -- it

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread Chris Angelico
On Tue, Apr 4, 2017 at 12:34 AM, Paul Moore wrote: > On Monday, 3 April 2017 15:10:12 UTC+1, Chris Angelico wrote: >> You're getting HTTP/1.1 requests. Maybe you need to send a >> "Connection: close" header to tell the browser to leave you be? > > That sounds possible - I don't really know enoug

Re: Improve Python + Influxdb import performance

2017-04-03 Thread INADA Naoki
You can reuse connection, instead of creating for each request. (HTTP keep-alive). On Tue, Apr 4, 2017 at 1:11 AM, Prathamesh wrote: > Hello World > > The following script is an extract from > > https://github.com/RittmanMead/obi-metrics-agent/blob/master/obi-metrics-agent.py > > <> > > import ca

Obtain Ceritificate Information from Invalid or Self-Signed Certificate in Python

2017-04-03 Thread Kenneth Buckler
I'm working on a Python 2.7.13 (Win x64) script to verify SSL certificates, and alert for problems. Specifically, I'm looking to return the date the cert expires or did expire. However, I'm running into an issue where the script will return information only if the certificate is valid. If the cert

Improve Python + Influxdb import performance

2017-04-03 Thread Prathamesh
Hello World The following script is an extract from https://github.com/RittmanMead/obi-metrics-agent/blob/master/obi-metrics-agent.py <> import calendar, time import sys import getopt print '---' # Check the arguments to this script are as expected. # argv[

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread Paul Moore
On Monday, 3 April 2017 15:10:12 UTC+1, Chris Angelico wrote: > You're getting HTTP/1.1 requests. Maybe you need to send a > "Connection: close" header to tell the browser to leave you be? That sounds possible - I don't really know enough about HTTP to even know that was a thing, so I'm not surp

RE: Two variable dictionary comprehension

2017-04-03 Thread Deborah Swanson
Gregory Ewing wrote, on April 02, 2017 11:35 PM > > Deborah Swanson wrote: > > > Oh, come on. That's a fairly obscure citation in the docs, one that > > would take a good deal of experience and time reading > through them to > > know was there, > > You seemed to know that there was something

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread Chris Angelico
On Mon, Apr 3, 2017 at 11:56 PM, Paul Moore wrote: > On Monday, 3 April 2017 14:20:43 UTC+1, Paul Moore wrote: >> On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote: >> > It should service the request and return to the serve_forever() loop. >> > Do you see a line logged for each request, l

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread Paul Moore
On Monday, 3 April 2017 14:20:43 UTC+1, Paul Moore wrote: > On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote: > > It should service the request and return to the serve_forever() loop. > > Do you see a line logged for each request, like "[IP] - - [date] "GET > > ..."? > > Yes, I see that a

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread eryk sun
On Mon, Apr 3, 2017 at 1:20 PM, Paul Moore wrote: > On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote: >> It should service the request and return to the serve_forever() loop. >> Do you see a line logged for each request, like "[IP] - - [date] "GET >> ..."? > > Yes, I see that and the page

EuroPython 2017: Launching early-bird sales tomorrow

2017-04-03 Thread M.-A. Lemburg
We are starting ticket sales tomorrow and, as is tradition, we have allocated a number of tickets to be sold at very low rates - in fact you can save between 40-50% on these early-bird rates, compared to the regular ticket prices. Sales at the early-bird rate will open tomorrow, April 4th,

Re: Spam user

2017-04-03 Thread Cholo Lennon
On 01/04/17 16:15, Mario R. Osorio wrote: I'm not in the business of starting an argument about best/worse newsreader, Ammammata, but could you please recommend a few? Mozilla Thunderbird works very well. Spam is close to nothing using this free nntp server: news.aioe.org Regards -- Chol

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread Paul Moore
On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote: > It should service the request and return to the serve_forever() loop. > Do you see a line logged for each request, like "[IP] - - [date] "GET > ..."? Yes, I see that and the page is served. >py .\example.py Serving HTTP on port 8000... 12

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread eryk sun
On Mon, Apr 3, 2017 at 12:34 PM, Paul Moore wrote: > On Monday, 3 April 2017 13:23:11 UTC+1, eryk sun wrote: >> It works for me when run from a command prompt in Windows 10. >> serve_forever() uses select() with a timeout of 0.5s, so it doesn't >> block the main thread. > > Odd. For me, it doesn

"pandas" pronunciation

2017-04-03 Thread Jay Braun
I hear people say it like the plural of "panda", and others as "panduss". Is there a correct way? j -- https://mail.python.org/mailman/listinfo/python-list

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread Paul Moore
On Monday, 3 April 2017 13:23:11 UTC+1, eryk sun wrote: > It works for me when run from a command prompt in Windows 10. > serve_forever() uses select() with a timeout of 0.5s, so it doesn't > block the main thread. Odd. For me, it doesn't work (Windows 7, but I can't see why that would affect it

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread eryk sun
On Mon, Apr 3, 2017 at 9:08 AM, Paul Moore wrote: > I know I've seen this before, but for the life of me I can't find any > reference. > > If I write a simple web server using wsgiref, something like > > from wsgiref.simple_server import make_server, demo_app > > with make_server('', 800

Re: Spam user

2017-04-03 Thread Ammammata
Il giorno Sat 01 Apr 2017 09:15:41p, *Mario R. Osorio* ha inviato su comp.lang.python il messaggio news:d0e9d036-2924-4c2c-99b1-0d8cb02b9...@googlegroups.com. Vediamo cosa ha scritto: > I'm not in the business of starting an argument about best/worse > newsreader, Ammammata, but could you please

SocketServer and Ctrl-C on Windows

2017-04-03 Thread Paul Moore
I know I've seen this before, but for the life of me I can't find any reference. If I write a simple web server using wsgiref, something like from wsgiref.simple_server import make_server, demo_app with make_server('', 8000, demo_app) as httpd: print("Serving HTTP on port 8000...

Re: Two variable dictionary comprehension

2017-04-03 Thread Chris Green
Gregory Ewing wrote: > > Part of being a good programmer is knowing how to track > down the information you need! > A very *large* part of it! :-) > Having said that, the index of the Python docs could be > improved a bit in this area -- currently it only mentions > "list" under "comprehensio

ANN: Python Meeting Düsseldorf - 05.04.2017

2017-04-03 Thread eGenix Team: M.-A. Lemburg
[This announcement is in German since it targets a local user group meeting in Düsseldorf, Germany] ANKÜNDIGUNG Python Meeting Düsseldorf http://pyddf.de/ Ein Tref

Re: Behavior of auto in Enum and Flag.

2017-04-03 Thread Oren Ben-Kiki
On Mon, Apr 3, 2017 at 11:03 AM, Ethan Furman wrote: > Python code is executed top-down. First FOO, then BAR, then BAZ. It is > not saved up and executed later in random order. Or, put another way, the > value was appropriate when it was chosen -- it is not the fault of auto() > that the user

Best practices interfacing to device with Python's asyncio and pyserial-asyncio

2017-04-03 Thread Malte Forkel
Hello, I have written a Python package to read from and write to a serial device that uses short telegrams to communicate with sensors and actuators. My classes include one to model the transceiver (it establishes the serial connection using serial.aio.create_serial_connection) and one for the tel

Re: Behavior of auto in Enum and Flag.

2017-04-03 Thread Ethan Furman
On 04/02/2017 09:49 PM, Oren Ben-Kiki wrote: The current behavior of `auto` is to pick a value which is one plus the previous value. Starting with 1 if no previous value exists. It would probably be better if `auto` instead picked a value that is not used by any named member (either the mini