Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Steven D'Aprano
On Thu, 25 May 2017 10:59:55 +1200, Gregory Ewing wrote: > bartc wrote: > >> Yet the language will stop you assigning to 672, or "abc". >> >> Maybe the language could have been made even smaller if that was not >> checked; after all the developer ought to be trusted not to assign to >> them! > >

Re: How to install Python package from source on Windows

2017-05-24 Thread Gregory Ewing
Deborah Swanson wrote: So now I'm pipless. You should be able to get it back using python -m ensurepip BTW, I don't know why upgrading pip would fail due to lack of Visual Studio. That shouldn't be able to happen, because pip is pure Python. -- Greg -- https://mail.python.org/mailman/lis

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Ian Kelly
On Wed, May 24, 2017 at 8:49 PM, wrote: > On Tuesday, May 23, 2017 at 11:47:21 PM UTC-4, bream...@gmail.com wrote: >> Well that's what is says here https://github.com/ofek/venum so it must be >> true. Please move over Ethan, your time is up :-) >> >> Kindest regards. >> >> Mark Lawrence. > > He

Re: How to install Python package from source on Windows

2017-05-24 Thread Chris Angelico
On Thu, May 25, 2017 at 2:20 PM, Deborah Swanson wrote: >> For packages that don't have wheels available on PyPI, you >> can often find an unofficial build on Christoph Gohlke's site >> [1]. He still builds and distributes wheels for Python 3.4, >> but I don't know for how much longer. >> >> [1]:

Re: Hi everyone

2017-05-24 Thread tommy yama
Hi Ian, yeah. feel free to ask for any relating python. thanks! On Thursday, May 25, 2017, Ian Kelly wrote: > On Wed, May 24, 2017 at 11:20 AM, Spaarwiel > wrote: > > > > Hi there, i was always interested in coding but never took the time to > learn it. > > > > So at age 34 i'm going to try a

RE: How to install Python package from source on Windows

2017-05-24 Thread Deborah Swanson
eryk sun wrote, on Wednesday, May 24, 2017 6:32 PM > > On Thu, May 25, 2017 at 12:18 AM, Deborah Swanson > wrote: > > > > When I tried to upgrade pip it failed because it could neither find > > nor install Visual Studio 2015. > > Installing and upgrading pip does not require a C compiler. >

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread ofekmeister
On Tuesday, May 23, 2017 at 11:47:21 PM UTC-4, bream...@gmail.com wrote: > Well that's what is says here https://github.com/ofek/venum so it must be > true. Please move over Ethan, your time is up :-) > > Kindest regards. > > Mark Lawrence. Hey I've just run some tests and have updated the doc

Re: How to install Python package from source on Windows

2017-05-24 Thread eryk sun
On Thu, May 25, 2017 at 12:18 AM, Deborah Swanson wrote: > > When I tried to upgrade pip it failed because it could neither > find nor install Visual Studio 2015. Installing and upgrading pip does not require a C compiler. > So now I'm pipless. Read the thread if you want to know why I don't hav

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Chris Angelico
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. > > I doubt that's still the case. With C, however, I tried

RE: How to install Python package from source on Windows

2017-05-24 Thread Deborah Swanson
Paul Moore wrote, on Wednesday, May 24, 2017 5:53 AM > On Monday, 15 May 2017 22:42:22 UTC+1, Deborah Swanson wrote: > > MRAB wrote, on Monday, May 15, 2017 12:44 PM > > > > > > On 2017-05-15 13:52, eryk sun wrote: > > > > On Mon, May 15, 2017 at 6:37 AM, Deborah Swanson > > > > wrote: > > > >>

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

2017-05-24 Thread Ethan Furman
Thank you for that write-up! I haven't used type hints, fearing pretty much the obstacles you ran into. The only thing I can (partially) offer is a tool, written by Google I believe, that parses and annotates code with the types the code is /currently/ working with. I say partially because I

Re: Logging function calls without changing code

2017-05-24 Thread Matt Wheeler
Hi Rajat, On Wed, 24 May 2017 at 20:05 Rajat Sharma wrote: > Is there a way to log all function calls of a class without changing > anything in that class. > Several... depending on what you want to achieve some may be more suited than others > What I mean to say is if I have written a class

Re: I need help with making my claculator

2017-05-24 Thread woooee
This is most likely using class objects instead of instance objects. Not a normal thing in Python. As stated above, it is difficult, as the responses in this thread show, to get assistance with some alternate coding style. It is better to use Python in the way that is intended. Otherwise, yo

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread bartc
On 24/05/2017 23:59, Gregory Ewing wrote: bartc wrote: Yet the language will stop you assigning to 672, or "abc". Maybe the language could have been made even smaller if that was not checked; after all the developer ought to be trusted not to assign to them! I'm told that some Fortran implem

Re: I need help with making my claculator

2017-05-24 Thread MRAB
On 2017-05-25 00:02, woo...@gmail.com wrote: How do you then run the mainloop, i.e. get it to do something? tkinter.mainloop() -- https://mail.python.org/mailman/listinfo/python-list

Re: I need help with making my claculator

2017-05-24 Thread woooee
How do you then run the mainloop, i.e. get it to do something? -- https://mail.python.org/mailman/listinfo/python-list

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Gregory Ewing
bartc wrote: Yet the language will stop you assigning to 672, or "abc". Maybe the language could have been made even smaller if that was not checked; after all the developer ought to be trusted not to assign to them! I'm told that some Fortran implementations experimented with something akin

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Gregory Ewing
bartc wrote: Anyway, my Python 3.4 comprises 5000 files in around 90MB. Minimalism hasn't really worked. Most of that is standard library code, not part of the core language. Well, named constants are just such literals, but with a name. The design of Python however means that that immediatel

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Gregory Ewing
Chris Angelico wrote: So Fred might still think "final is great, my stuff runs 0.1% faster", but Joe thinks "final is a pain in the behind". C# addresses this issue by making final the default. That way, your behind is so numb from constant pain that you don't really notice it, and the relief f

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Gregory Ewing
Steve D'Aprano wrote: But I'll note that Python has supported read-only properties for, oh, a decade or more, and do I hear people complaining about how much libraries and applications over-use and abuse properties? That's not quite the same thing. Python doesn't go out of its way to support re

adding type hints to one of my projects, things learned

2017-05-24 Thread Irmen de Jong
Hi, I wanted to share my experience with adding type hints to one of my projects. TL;DR: There were some benefits, mypy discovered a couple of bugs, there are a few annoyances for me, and I am not really sold on it yet. Please correct my mistakes or help me solve some problems if possible :) (

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Ian Kelly
On Wed, May 24, 2017 at 4:11 PM, bartc wrote: > On 24/05/2017 15:31, Steve D'Aprano wrote: >> If you don't want to assign to a name, then >> just don't assign to it. No need to build support for constants into the >> language when you can trust the developer to Don't Do That. > > Yet the language

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread bartc
On 24/05/2017 15:31, Steve D'Aprano wrote: Same as if Python supported constants (names that can only be assigned to once). That's not quite the same as my notion of 'named constant' that I expand below. This suggests that the actual literal bound to the name may not be known until runtime.

Re: dictConfig: logging.StreamHandler object is not iterable.

2017-05-24 Thread Peter Otten
Tim Williams wrote: > Just as a followup, if I use 'unrepr=True' in my ConfigObj, I don't have > to convert the strings. I'd keep it simple and would use JSON... -- https://mail.python.org/mailman/listinfo/python-list

Re: dictConfig: logging.StreamHandler object is not iterable.

2017-05-24 Thread Tim Williams
On Wednesday, May 24, 2017 at 2:46:54 PM UTC-4, Tim Williams wrote: > (Apologies for using Google Groups to post) > > I'm trying to use dictConfig to configure logging. I keep running into the > error that the logging.StreamHandler object is not iterable. > > I'm using Python 3.4.3 on a Windows

Re: dictConfig: logging.StreamHandler object is not iterable.

2017-05-24 Thread Tim Williams
On Wednesday, May 24, 2017 at 2:46:54 PM UTC-4, Tim Williams wrote: > (Apologies for using Google Groups to post) > > I'm trying to use dictConfig to configure logging. I keep running into the > error that the logging.StreamHandler object is not iterable. > > I'm using Python 3.4.3 on a Windows

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Chris Angelico
On Thu, May 25, 2017 at 12:31 AM, Steve D'Aprano wrote: > On Wed, 24 May 2017 10:07 pm, Chris Angelico wrote: > >> I'm sure it could be done. But would it really benefit anyone >> anything? Java has "final" classes, which can't be subclassed; and I >> haven't heard many people saying "I wish you w

Re: dictConfig: logging.StreamHandler object is not iterable.

2017-05-24 Thread Peter Otten
Tim Williams wrote: > (Apologies for using Google Groups to post) > > I'm trying to use dictConfig to configure logging. I keep running into the > error that the logging.StreamHandler object is not iterable. > > I'm using Python 3.4.3 on a Windows 7 box. > > C:\Python34\python.exe 3.4.3 (v3.4.3

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Ian Kelly
On Wed, May 24, 2017 at 3:10 AM, Steve D'Aprano wrote: > The page says: > > venum provides an Enum that is actually just a namedtuple, No kidding. This is the entirety of the code for it: from collections import namedtuple def Enum(*args, **kwargs): fields, values = zip(*args) ret

Logging function calls without changing code

2017-05-24 Thread Rajat Sharma
Hi Everyone, Is there a way to log all function calls of a class without changing anything in that class. What I mean to say is if I have written a class previously and I want to enable logging in that then I would probably need to write the following before my function calls- logger.debug('

dictConfig: logging.StreamHandler object is not iterable.

2017-05-24 Thread Tim Williams
(Apologies for using Google Groups to post) I'm trying to use dictConfig to configure logging. I keep running into the error that the logging.StreamHandler object is not iterable. I'm using Python 3.4.3 on a Windows 7 box. C:\Python34\python.exe 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40

Re: Concatenating files in order

2017-05-24 Thread Peter Otten
bartc wrote: > On 24/05/2017 16:41, Peter Otten wrote: >> Dennis Lee Bieber wrote: >> >>> On Tue, 23 May 2017 21:42:45 +0100, bartc declaimed the >>> following: >>> Is it necessary to sort them? If XXX is known, then presumably the first file will be called XXX_chunk_0, the next XXX_chu

Re: Hi everyone

2017-05-24 Thread Ian Kelly
On Wed, May 24, 2017 at 11:20 AM, Spaarwiel wrote: > > Hi there, i was always interested in coding but never took the time to learn it. > > So at age 34 i'm going to try and see if i can win this. > > Saw on a website this is good group page to come for help so i will def. be asking alot of questi

Hi everyone

2017-05-24 Thread Spaarwiel
Hi there, i was always interested in coding but never took the time to learn it. So at age 34 i'm going to try and see if i can win this. Saw on a website this is good group page to come for help so i will def. be asking alot of questions here :) B.t.w i have no knowledge of coding whatsoever s

Re: Concatenating files in order

2017-05-24 Thread bartc
On 24/05/2017 16:41, Peter Otten wrote: Dennis Lee Bieber wrote: On Tue, 23 May 2017 21:42:45 +0100, bartc declaimed the following: Is it necessary to sort them? If XXX is known, then presumably the first file will be called XXX_chunk_0, the next XXX_chunk_1 and so on. XXX_chunk_1 XXX_chu

Re: Concatenating files in order

2017-05-24 Thread Peter Otten
Dennis Lee Bieber wrote: > On Tue, 23 May 2017 21:42:45 +0100, bartc declaimed the > following: > >>Is it necessary to sort them? If XXX is known, then presumably the first >>file will be called XXX_chunk_0, the next XXX_chunk_1 and so on. >> > > XXX_chunk_1 > XXX_chunk_10 > XXX_chunk_2 This i

constants in Python [was: Verifiably better, validated Enum for Python]

2017-05-24 Thread Ethan Furman
On 05/24/2017 07:31 AM, Steve D'Aprano wrote: On Wed, 24 May 2017 10:07 pm, Chris Angelico wrote: On Wed, May 24, 2017 at 7:10 PM, Steve D'Aprano wrote: Although I wonder: - maybe the enumeration (the class ContentTypes) could have a nicer repr than - maybe you could add functionality to

EuroPython 2017: Social event tickets available

2017-05-24 Thread M.-A. Lemburg
After trainings and talks, EuroPython is going (Coco)nuts ! Join us for the EuroPython social event in Rimini, which will be held in the Coconuts Club on Thursday, July 13th. * EuroPython 2017 Social Event * https://ep2017.europython.eu/en/events/social-event/ Ticke

Re: Scala considering significant indentation like Python

2017-05-24 Thread Rustom Mody
On Wednesday, May 24, 2017 at 2:14:15 AM UTC+5:30, Ben Finney wrote: > Grant Edwards grant.b.edwards writes: > > > On 2017-05-23, Michael Torrie wrote: > > > Sometimes things get longer than a page (like a class definition). > > > > A nice folding mode works nicely for that sort of thing. I norma

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Steve D'Aprano
On Wed, 24 May 2017 10:07 pm, Chris Angelico wrote: > On Wed, May 24, 2017 at 7:10 PM, Steve D'Aprano > wrote: >> Although I wonder: >> >> - maybe the enumeration (the class ContentTypes) could have a nicer repr >> than >> >> >> >> - maybe you could add functionality to freeze the enumeration so

Re: Scala considering significant indentation like Python

2017-05-24 Thread Grant Edwards
On 2017-05-23, Ben Finney wrote: > Grant Edwards writes: > >> On 2017-05-23, Michael Torrie wrote: >> > Sometimes things get longer than a page (like a class definition). >> >> A nice folding mode works nicely for that sort of thing. I normally >> use emacs, but it doesn't seem to have a folding

Re: SSL certificate of a server on Windows

2017-05-24 Thread COPIN Mathieu.
Le mardi 23 mai 2017 19:10:11 UTC+2, Irmen de Jong a écrit : > On 23-5-2017 10:19, COPIN Mathieu. wrote: > > Hi, > > > > I want to get a server certificate from the host-name. > > > > I know I could do something like : > >> call(openssl, s_client, -showcerts, -connect, hostname:port) > > > > >

Re: How to install Python package from source on Windows

2017-05-24 Thread Paul Moore
On Monday, 15 May 2017 22:42:22 UTC+1, Deborah Swanson wrote: > MRAB wrote, on Monday, May 15, 2017 12:44 PM > > > > On 2017-05-15 13:52, eryk sun wrote: > > > On Mon, May 15, 2017 at 6:37 AM, Deborah Swanson > > > wrote: > > >> > > >> Where did you find recordclass-0.4.3-cp34-cp34m-win32.whl?

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Chris Angelico
On Wed, May 24, 2017 at 7:10 PM, Steve D'Aprano wrote: > Although I wonder: > > - maybe the enumeration (the class ContentTypes) could have a nicer repr > than > > > > - maybe you could add functionality to freeze the enumeration so that new > members cannot be added? > > > class ContentTypes(Enu

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Steve D'Aprano
On Wed, 24 May 2017 01:47 pm, breamore...@gmail.com wrote: > Well that's what is says here https://github.com/ofek/venum so it must be > true. Please move over Ethan, your time is up :-) The page says: venum provides an Enum that is actually just a namedtuple, but easier to create. Thi

Re: Building a PDF from Byte-of-Python

2017-05-24 Thread ElChino
Dennis Lee Bieber wrote: As for creating a PDF -- that is described in the about.md file (it uses "gitbook") Thanks. Tried Gitbook after downloading it. Yuk! But I had some success using "sphinx-quickstart --batchfile" and tweaking the generated source/conf.py file and a hand-generated

threading.Semaphore or gevent.lock.Semaphore

2017-05-24 Thread Sergey
Hello, I'm developing Flask app, processed by gevent.wsgi.WSGIServer. If I need to isolate some pieces of code inside request handlers, can I use threading.Lock? If I need semaphore, must I use threading.Semaphore or gevent.lock.Semaphore? What is the difference between them? Thank you! -- http

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Chris Angelico
On Wed, May 24, 2017 at 5:22 PM, Ethan Furman wrote: > On 05/23/2017 08:47 PM, breamore...@gmail.com wrote: > >> Well that's what is says here https://github.com/ofek/venum so it must be >> true. Please move over Ethan, your time is up :-) > > > No comment. > # No longer no comment. ChrisA --

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread Ethan Furman
On 05/23/2017 08:47 PM, breamore...@gmail.com wrote: Well that's what is says here https://github.com/ofek/venum so it must be true. Please move over Ethan, your time is up :-) No comment. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list