Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Chris Angelico
On Sat, May 27, 2017 at 3:31 PM, Steve D'Aprano wrote: > Python has nothing like that. What we have is a collection of ad hoc and > subjective heuristics. If you want to call that a de facto standard, I'm > okay with that, so long as we're aware of the significant gap between a de > facto standard

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Steve D'Aprano
On Sat, 27 May 2017 02:20 pm, Chris Angelico wrote: > On Sat, May 27, 2017 at 12:59 PM, Steve D'Aprano > wrote: >>> What is a standards-compliant Python interpreter allowed to do? >> >> There's no such thing, so your question is moot. >> >> There is no Python standard. There's only: >> >> - do wh

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Chris Angelico
On Sat, May 27, 2017 at 12:59 PM, Steve D'Aprano wrote: >> What is a standards-compliant Python interpreter allowed to do? > > There's no such thing, so your question is moot. > > There is no Python standard. There's only: > > - do what CPython does; > > - do what the documentation says; > > - if

Re: Top Python Interview Questions

2017-05-26 Thread Chris Angelico
On Sat, May 27, 2017 at 12:19 PM, Steve D'Aprano wrote: > On Sat, 27 May 2017 09:37 am, Chris Angelico wrote: > >> On Sat, May 27, 2017 at 8:56 AM, Larry Martell >> wrote: >>> If they write a loop with range(1,10) they are going in the 'no' pile. >>> If they write a loop with range(1,11) they go

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Larry Hudson via Python-list
On 05/26/2017 04:46 AM, Steve D'Aprano wrote: [snip..]> That's not how the C standard defines "undefined behaviour", or the implication of such. A little OT here, but... This brings to mind this entry in the Jargon File: http://catb.org/jargon/html/N/nasal-demons.html -- -=- Larry -=- -

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Steve D'Aprano
On Sat, 27 May 2017 09:36 am, Chris Angelico wrote: > On Sat, May 27, 2017 at 8:48 AM, Steve D'Aprano > wrote: >> I don't actually believe that any real compiler will *literally* contain >> code that looks like this: >> >> >> if phase_of_moon(now()) != X: >> # emit machine code you expected >

Re: Top Python Interview Questions

2017-05-26 Thread Steve D'Aprano
On Sat, 27 May 2017 09:37 am, Chris Angelico wrote: > On Sat, May 27, 2017 at 8:56 AM, Larry Martell > wrote: >> If they write a loop with range(1,10) they are going in the 'no' pile. >> If they write a loop with range(1,11) they go in the maybe pile >> If the write sum([i*i for i in range(1,11)]

Re: Sybil 1.0.0 Released!

2017-05-26 Thread Skip Montanaro
On Fri, May 26, 2017 at 2:34 AM, Chris Withers wrote: > The package is on PyPI and a full list of all the links to docs, issue > trackers and the like can be found here: > > https://github.com/cjw96/sybil > Chris, The GitHub URL 404s for me. Skip -- https://mail.python.org/mailman/listinfo/py

Re: Top Python Interview Questions

2017-05-26 Thread Chris Angelico
On Sat, May 27, 2017 at 8:56 AM, Larry Martell wrote: > If they write a loop with range(1,10) they are going in the 'no' pile. > If they write a loop with range(1,11) they go in the maybe pile > If the write sum([i*i for i in range(1,11)]) and sqrt(sum([i for i in > range(1,11)])) they are going i

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Chris Angelico
On Sat, May 27, 2017 at 8:48 AM, Steve D'Aprano wrote: > I don't actually believe that any real compiler will *literally* contain > code that looks like this: > > > if phase_of_moon(now()) != X: > # emit machine code you expected > else: > # erase your hard drive > > > but if one did, that

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Steve D'Aprano
On Fri, 26 May 2017 10:01 pm, Chris Angelico wrote: >> That's not how the C standard defines "undefined behaviour", or the >> implication of such. > > Can you explain to me how it's different? Either way, the > implementation is allowed to do what it likes, because you shouldn't > be doing that.

Re: Top Python Interview Questions

2017-05-26 Thread Larry Martell
On Fri, May 26, 2017 at 1:03 AM, Aarusha wrote: > PYTHON INTERVIEW QUESTIONS > > Mindmajix has compiled Python Interview questions which would benefit the > learners to attend the Python interviews. > > Q. How is Python executed? > > Python files are compiled to bytecode. which is then executed b

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Steve D'Aprano
On Fri, 26 May 2017 10:56 pm, Rhodri James wrote: > On 26/05/17 12:46, Steve D'Aprano wrote: >> On Thu, 25 May 2017 11:26 am, Chris Angelico wrote: >> >>> On Thu, May 25, 2017 at 9:34 AM, bartc wrote: That was quite likely with older Fortrans, where subroutines only used pass-by-refere

Where is pydlna-server?

2017-05-26 Thread MoonKid
I have read about a project called "pydlna-server". But it looks like that it is gone. Does anyone know about that project, the source or have contact to the last maintainer. There is an google archive page about it -- https://mail.python.org/mailman/listinfo/python-l

Re: using configobj string interpolation and logging.config.dictConfig

2017-05-26 Thread Peter Otten
Tim Williams wrote: > I've spent too much time trying to track this down. I'll just hard-code my > filename in my INI file. Maybe I'll get back to it, but I need to move on. The only alternative I see would be to build your own InterpolationEngine which understands some kind of escaping so that

Re: Check for regular expression in a list

2017-05-26 Thread Peter Otten
Jussi Piitulainen wrote: > Surely that should be: > > if not 'firefox' in (i.name() for i in process_iter()): > > And that again should be: > > if any((i.name() == 'firefox') for i in process_iter()): The previous one certainly looks better than this, particularly if you move the `not

Re: using configobj string interpolation and logging.config.dictConfig

2017-05-26 Thread Tim Williams
On Friday, May 26, 2017 at 8:37:38 AM UTC-4, Tim Williams wrote: > On Friday, May 26, 2017 at 8:32:19 AM UTC-4, Tim Williams wrote: > > On Thursday, May 25, 2017 at 9:43:40 PM UTC-4, Tim Williams wrote: > > > On Thursday, May 25, 2017 at 5:16:13 PM UTC-4, Peter Otten wrote: > > (snip) > > > > ... >

Open this XML file to create dataframe in Python

2017-05-26 Thread Umar Yusuf
Hello, How do I open this XML file to create Python pandas dataframe? https://www.dropbox.com/s/83e9r36z39zj8ve/sample.xml?dl=0 https://www.dropbox.com/home?preview=sample.xml -- https://mail.python.org/mailman/listinfo/python-list

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread bartc
On 26/05/2017 12:46, Steve D'Aprano wrote: On Thu, 25 May 2017 11:26 am, Chris Angelico wrote: And why should they try to stop you? The whole point of undefined behaviour is that you shouldn't be doing this, so if you do, the interpreter's allowed to do anything. Does the C specification act

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Rustom Mody
On Friday, May 26, 2017 at 7:11:50 PM UTC+5:30, Chris Angelico wrote: > On Fri, May 26, 2017 at 10:52 PM, Rustom Mody wrote: > >> Can you explain to me how it's different? Either way, the > >> implementation is allowed to do what it likes, because you shouldn't > >> be doing that. > > > > I am gue

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Chris Angelico
On Fri, May 26, 2017 at 10:52 PM, Rustom Mody wrote: >> Can you explain to me how it's different? Either way, the >> implementation is allowed to do what it likes, because you shouldn't >> be doing that. > > I am guessing that Steven is mixing up undefined and unspecified behavior > > Undefined :

Re: Check for regular expression in a list

2017-05-26 Thread Cecil Westerhof
On Friday 26 May 2017 14:25 CEST, Jussi Piitulainen wrote: > Rustom Mody writes: > >> On Friday, May 26, 2017 at 5:02:55 PM UTC+5:30, Cecil Westerhof wrote: >>> To check if Firefox is running I use: >>> if not 'firefox' in [i.name() for i in list(process_iter())]: >>> >>> It probably could be mad

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Rhodri James
On 26/05/17 12:46, Steve D'Aprano wrote: On Thu, 25 May 2017 11:26 am, Chris Angelico wrote: On Thu, May 25, 2017 at 9:34 AM, bartc wrote: That was quite likely with older Fortrans, where subroutines only used pass-by-reference, but which didn't stop you passing references to constants that t

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Rustom Mody
On Friday, May 26, 2017 at 5:31:54 PM UTC+5:30, Chris Angelico wrote: > On Fri, May 26, 2017 at 9:46 PM, Steve D'Aprano wrote: > > > >> And yes, Steve, this is a challenge to you: if you think C's undefined > >> behaviour is an abomination that should not be allowed to exist, > > > > CPython doesn'

Re: Check for regular expression in a list

2017-05-26 Thread Rustom Mody
On Friday, May 26, 2017 at 5:55:32 PM UTC+5:30, Jussi Piitulainen wrote: > Rustom Mody writes: > > > On Friday, May 26, 2017 at 5:02:55 PM UTC+5:30, Cecil Westerhof wrote: > >> To check if Firefox is running I use: > >> if not 'firefox' in [i.name() for i in list(process_iter())]: > >> > >> I

Re: using configobj string interpolation and logging.config.dictConfig

2017-05-26 Thread Tim Williams
On Friday, May 26, 2017 at 8:32:19 AM UTC-4, Tim Williams wrote: > On Thursday, May 25, 2017 at 9:43:40 PM UTC-4, Tim Williams wrote: > > On Thursday, May 25, 2017 at 5:16:13 PM UTC-4, Peter Otten wrote: > (snip) > > > ... > > > > > > How do you get > > > > > > > LogFile = '%(CaptureDrive)s%(Root

Re: Check for regular expression in a list

2017-05-26 Thread Jussi Piitulainen
Jussi Piitulainen writes: > Or use a regex match if the condition becomes more complex. Even then, > there is re.match to attemp a match at the start of the string, which > helps to keep the expression simple. Soz: attemp' a match. -- https://mail.python.org/mailman/listinfo/python-list

Re: using configobj string interpolation and logging.config.dictConfig

2017-05-26 Thread Tim Williams
On Thursday, May 25, 2017 at 9:43:40 PM UTC-4, Tim Williams wrote: > On Thursday, May 25, 2017 at 5:16:13 PM UTC-4, Peter Otten wrote: (snip) > > ... > > > > How do you get > > > > > LogFile = '%(CaptureDrive)s%(RootDir)s/test.log' > > > > to be interpolated while leaving > > > > > format = '%(

Re: Check for regular expression in a list

2017-05-26 Thread Jussi Piitulainen
Rustom Mody writes: > On Friday, May 26, 2017 at 5:02:55 PM UTC+5:30, Cecil Westerhof wrote: >> To check if Firefox is running I use: >> if not 'firefox' in [i.name() for i in list(process_iter())]: >> >> It probably could be made more efficient, because it can stop when it >> finds the firs

Re: Check for regular expression in a list

2017-05-26 Thread Tim Chase
On 2017-05-26 13:29, Cecil Westerhof wrote: > To check if Firefox is running I use: > if not 'firefox' in [i.name() for i in list(process_iter())]: > > It probably could be made more efficient, because it can stop when > it finds the first instance. > > But know I switched to Debian and there

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Chris Angelico
On Fri, May 26, 2017 at 9:46 PM, Steve D'Aprano wrote: > >> And yes, Steve, this is a challenge to you: if you think C's undefined >> behaviour is an abomination that should not be allowed to exist, > > CPython doesn't have to define the behaviour here. In *that* sense, the > ordinary, regular sen

Re: adding type hints to one of my projects, things learned

2017-05-26 Thread Steve D'Aprano
On Thu, 25 May 2017 08:37 am, Irmen de Jong wrote: > Hi, > > I wanted to share my experience with adding type hints to one of my > projects. Thanks for the write-up! [...] > Right now, I am not really sure if I want to continue to use type hints. > In Tale I probably will because it now has the

Re: Check for regular expression in a list

2017-05-26 Thread Rustom Mody
On Friday, May 26, 2017 at 5:02:55 PM UTC+5:30, Cecil Westerhof wrote: > To check if Firefox is running I use: > if not 'firefox' in [i.name() for i in list(process_iter())]: > > It probably could be made more efficient, because it can stop when it > finds the first instance. > > But know I s

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread Steve D'Aprano
On Thu, 25 May 2017 11:26 am, Chris Angelico wrote: > On Thu, May 25, 2017 at 9:34 AM, bartc wrote: >> That was quite likely with older Fortrans, where subroutines only used >> pass-by-reference, but which didn't stop you passing references to >> constants that the subroutine could then modify. >

Check for regular expression in a list

2017-05-26 Thread Cecil Westerhof
To check if Firefox is running I use: if not 'firefox' in [i.name() for i in list(process_iter())]: It probably could be made more efficient, because it can stop when it finds the first instance. But know I switched to Debian and there firefox is called firefox-esr. So I should use: re.se

EuroPython 2017: Full session list online

2017-05-26 Thread M.-A. Lemburg
After the final review round, we are now happy to announce the complete list of more than 200 accepted sessions. * EuroPython 2017 Session List * https://ep2017.europython.eu/en/events/sessions/ Here’s what we have on offer: - 5 keynotes - 157 talks - 20 train

Re: Top Python Interview Questions

2017-05-26 Thread Akira Li
Terry Reedy writes: > On 5/26/2017 1:03 AM, Aarusha wrote: >> PYTHON INTERVIEW QUESTIONS >> >> Mindmajix has compiled Python Interview questions which would >> benefit the learners to attend the Python interviews. >> >> Q. How is Python executed? > > It depends on the implementation (interpreter

Re: مسلسلات رمضان 2017

2017-05-26 Thread Blondy
بتاريخ الأربعاء، 24 مايو، 2017 4:31:25 م UTC+2، كتب basnt: > مسلسلات رمضان 2017 > > جدول مسلسلات رمضان 2017 - مواعيد عرض التليفزيون، دليل ... > https://goo.gl/9CG4CW > تدور احداث المسلسل حول المواقف الاجتماعية التي تمر بها المرأة قبل وبعد > الزواج، من خلال تسليط الضوء على قصص أربعة صديقات يتفرقن

Re: Concatenating files in order

2017-05-26 Thread Mahmood Naderan via Python-list
Thank you very much. I understand that Regards, Mahmood On Friday, May 26, 2017 5:01 AM, Cameron Simpson wrote: On 25May2017 20:37, Mahmood Naderan wrote: >Cameron, thanks for the points. In fact the file name contains multiple '_' >characters. So, I appreciate what you recommended. > >

Sybil 1.0.0 Released!

2017-05-26 Thread Chris Withers
Hi All, I'm pleased to announce the first release of Sybil, a library to help you test the examples in your documents. For example, given the following Sphinx source file: Sample Documentation Let's put something in the Sybil document's namespace: .. inv

Re: How to install Python package from source on Windows

2017-05-26 Thread Gregory Ewing
Deborah Swanson wrote: Since none of you have XP SP2 with Anaconda3 Python 3.4.3, to either confirm or deny my results, and I no longer have the message with the traceback showing what happened, nothing anybody says at this point matters wrt to what happens in XP SP2. Have you posted a transcri

Re: Top Python Interview Questions

2017-05-26 Thread Rustom Mody
On Friday, May 26, 2017 at 12:28:30 PM UTC+5:30, Steve D'Aprano wrote: > On Fri, 26 May 2017 03:32 pm, Terry Reedy wrote: > > >> Python files are compiled to bytecode. > > > > CPython compiles to cpython bytecode. > > Jython compiles to Java. > > Iron Python compiles to C#. > > Technically, they

Re: Top Python Interview Questions

2017-05-26 Thread Steve D'Aprano
On Fri, 26 May 2017 03:32 pm, Terry Reedy wrote: >> Python files are compiled to bytecode. > > CPython compiles to cpython bytecode. > Jython compiles to Java. > Iron Python compiles to C#. Technically, they compile to the JVM byte code and the .Net Common Runtime (I forget the three letter acro