Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Steven D'Aprano
On Tue, 03 Jul 2018 19:28:43 -0700, Jim Lee wrote: > On 07/03/18 16:51, Steven D'Aprano wrote: >> >> I love watching pedantically precise people panic and dig themselves >> into a hole. Since I'm an extremely pedantic person myself, I can >> recognise it in others -- especially when they're not as

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Steven D'Aprano
On Sun, 01 Jul 2018 17:22:43 -0500, Tim Daneliuk wrote: >> x: int = 3 [...] > This strikes me as syntactic noise. Python is dynamically typed and > will remain so. Why clutter the language - even optionally - with stuff > like this? There's no need to declare x:int = 3 since any linter worth it

Infinity [was Re: PEP 526 - var annotations and the spirit of python]

2018-07-03 Thread Steven D'Aprano
On Wed, 04 Jul 2018 12:31:16 +1000, Chris Angelico wrote: [...] >> Ah, I see we're not going to leave it alone. In that case, >> "indefinite" >> is a "number", in that it was a quantity you cited along with the other >> two. If you'd prefer to call it a "quantity", that's fine with me. >> Talk a

openstack connection

2018-07-03 Thread jayshankar nair via Python-list
Hi, I am trying to establish a connection to openstack cloud . I am able to establish a connection with the following statement from openstack import connectionconn = connection.Connection(auth_url="http://192.168.0.19:5000/v3",                      project_name="admin",username="admin",     

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Jim Lee
On 07/03/18 22:03, Ben Finney wrote: Jim Lee writes: I claimed that Steven was using three different numbers to refer to the time it takes to master a subject: 10,000 hours an indefinite number 2 years Yes. He did so in the context of showing that *there is no precise number* that universa

Re: Congrats to Chris for breaking his PEP curse

2018-07-03 Thread Ian Kelly
Now that I've actually read the PEP (sorry, I just assumed it would never fly), I have a couple of (tongue-in-cheek) observations about it: > group = re.match(data).group(1) if re.match(data) else None The only problem with this example of doing more work to save a line of code is that presumably

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Ben Finney
Jim Lee writes: > I claimed that Steven was using three different numbers to refer to > the time it takes to master a subject: > > 10,000 hours > an indefinite number > 2 years Yes. He did so in the context of showing that *there is no precise number* that universally applies for the amount of e

Re: Python 3.7 configuration issue

2018-07-03 Thread dieter
Robin Becker writes: > On a Ubuntu trusty system I ran > ./configure --prefix=/home/rptlab/PYTHON > make && make install > and get an error related to the ctypes module not being importable. > > I needed to do > > sudo apt-get install libffi-dev > ./configure --prefix=/home/rptlab/PYTHON --with-s

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Jim Lee
On 07/03/18 21:35, Ben Finney wrote: Abdur-Rahmaan Janhangeer writes: apart from programming, other questions go like this : […] *cut at this point* Ooh, I like that last step! How do we make that happen on demand? You could start by not adding to the noise... :) -- https://mail.python.

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Jim Lee
On 07/03/18 21:25, Ben Finney wrote: Jim Lee writes: On 07/03/18 19:58, Ben Finney via Python-list wrote: Jim Lee writes: If you were to say John had 2 apples, Jane had 4 apples, and Joe had an indefinite number of apples, how many numbers are we talking about? Three numbers. And “indef

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Abdur-Rahmaan Janhangeer
conversation dies it denotes the end of the picture i was painting Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Ben Finney
Abdur-Rahmaan Janhangeer writes: > apart from programming, other questions go like this : > > […] > *cut at this point* Ooh, I like that last step! How do we make that happen on demand? -- \ “Everything you read in newspapers is absolutely true, except | `\for that rare story

Re: Getting posts to sort chronologically in tree view

2018-07-03 Thread Ben Finney
T Berger writes: > On Tuesday, July 3, 2018 at 4:00:03 PM UTC-4, Ben Finney wrote: > > Given that history [of ignoring user requests for improvement], you > > might want to avoid Google Groups for interacting with forums, and > > choose software that works better with discussion forums. I am told

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Abdur-Rahmaan Janhangeer
list members have a nice way to wriggle out of the subject ^^_ apart from programming, other questions go like this : asker : what do you think about this python thing? next post : *on track* next post : *on track* next post : *on track* btw thon is the name of a fish in french next post : a

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Ben Finney
Jim Lee writes: > On 07/03/18 19:58, Ben Finney via Python-list wrote: > > Jim Lee writes: > > > >> If you were to say John had 2 apples, Jane had 4 apples, and Joe had > >> an indefinite number of apples, how many numbers are we talking about? > > Three numbers. And “indefinite” is not one of t

Re: Congrats to Chris for breaking his PEP curse

2018-07-03 Thread Abdur-Rahmaan Janhangeer
https://www.reddit.com/r/Python/comments/8vmq27/pep_572_assignment_expressions_is_officially/ XD nice feedbacks about the pep Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ On Wed, 4 Jul 2018, 06:02 Steven D'Aprano, < steve+comp.lang.pyt...@pearwood.info> wrote: > Congratulations to

Re: Getting posts to sort chronologically in tree view

2018-07-03 Thread T Berger
On Tuesday, July 3, 2018 at 4:00:03 PM UTC-4, Ben Finney wrote: > T Berger writes: > > > I'm posting directly to the forum (computer.lang.python, at this web > > address: > > https://groups.google.com/forum/#!topic/comp.lang.python/vWCvLYjOWUQ) > > Thanks for being specific. So, from that descri

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Jim Lee
On 07/03/18 19:58, Ben Finney via Python-list wrote: Jim Lee writes: If you were to say John had 2 apples, Jane had 4 apples, and Joe had an indefinite number of apples, how many numbers are we talking about? Three numbers. And “indefinite” is not one of those numbers. So, no, that doesn't

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Ben Finney via Python-list
Jim Lee writes: > If you were to say John had 2 apples, Jane had 4 apples, and Joe had > an indefinite number of apples, how many numbers are we talking about? Three numbers. And “indefinite” is not one of those numbers. So, no, that doesn't support “"indefinite" is a number”. -- \“Th

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Jim Lee
On 07/03/18 19:31, Chris Angelico wrote: I've had debates with people about whether "infinity" is a number or not, but I've never yet heard anyone say that "indefinite" is a number. Hmm. This could be interesting. ChrisA If you were to say John had 2 apples, Jane had 4 apples, and Joe had a

Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-07-03 Thread Marko Rauhamaa
Grant Edwards : > Found a NetBSD 7.1 system to test on... > > After killing a server with an active connection, a new server can > bind to the same socket regardless of the SO_REUSEADDR setting in > either server. I don't know if that's some sort of system > configuration setting or what... The qu

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Chris Angelico
On Wed, Jul 4, 2018 at 12:28 PM, Jim Lee wrote: > > > On 07/03/18 16:51, Steven D'Aprano wrote: >> >> >> I love watching pedantically precise people panic and dig themselves into >> a hole. Since I'm an extremely pedantic person myself, I can recognise it >> in others -- especially when they're no

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Jim Lee
On 07/03/18 16:51, Steven D'Aprano wrote: I love watching pedantically precise people panic and dig themselves into a hole. Since I'm an extremely pedantic person myself, I can recognise it in others -- especially when they're not as precisely correct as they think they're being. It was two n

Re: Congrats to Chris for breaking his PEP curse

2018-07-03 Thread Chris Angelico
On Wed, Jul 4, 2018 at 11:59 AM, Steven D'Aprano wrote: > Congratulations to Chris Angelico for breaking the dreaded "any PEP > written by Chris will be rejected" curse :-) I'm actually somewhat astonished at that part. But thanks anyway. ChrisA -- https://mail.python.org/mailman/listinfo/pytho

Congrats to Chris for breaking his PEP curse

2018-07-03 Thread Steven D'Aprano
Congratulations to Chris Angelico for breaking the dreaded "any PEP written by Chris will be rejected" curse :-) Guido has announced his intention to accept PEP 572 (assignment expressions) once the PEP has been cleaned up a bit. https://www.python.org/dev/peps/pep-0572/ (The current version o

Re: .replace("a" or "b")

2018-07-03 Thread Steven D'Aprano
On Tue, 03 Jul 2018 07:52:42 +0400, Abdur-Rahmaan Janhangeer wrote: > .replace("a" or "b") Oh I *wish* Python accepted that syntax to mean what you thought it meant. That's a common error: a surprising number of beginners are fooled by how close Python is to natural language and try writing th

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Steven D'Aprano
On Tue, 03 Jul 2018 09:14:37 -0700, Jim Lee wrote: > On 07/03/18 01:34, Steven D'Aprano wrote: >> I said *indefinite* not infinite. > > Yes, you did.  My bad. Thanks Jim, your acknowledgement is appreciated. >> You did read the article I linked to, right? You know that people don't >> suddenly

Re: Python 3.7 Windows Help Behaviour

2018-07-03 Thread BlindAnagram
On 03/07/2018 03:41, Terry Reedy wrote: > On 7/2/2018 8:57 PM, Steven D'Aprano wrote: >> On Fri, 29 Jun 2018 12:53:15 -0400, Terry Reedy wrote: >> >>> On 6/29/2018 6:14 AM, BlindAnagram wrote: In Python 3.7.0 on Windows the help file (python370.chm) displays with a fixed line length and d

Re: Multi-threading with a simple timer?

2018-07-03 Thread David D
I have some success with this. I am not sure if this would work longer term, as in restarting it, but so far so good. Any issue with this new code? import time from threading import Thread th=Thread() class Answer(Thread): def run(self): a=input("What is your answer:") if a

Re: Getting posts to sort chronologically in tree view

2018-07-03 Thread Ben Finney
T Berger writes: > I'm posting directly to the forum (computer.lang.python, at this web > address: > https://groups.google.com/forum/#!topic/comp.lang.python/vWCvLYjOWUQ) Thanks for being specific. So, from that description, you are using the Google Groups web interface to read and send messages

django-raster rendering raster url

2018-07-03 Thread Xristos Xristoou
i want to add raster functionality in django using postgis database using django-raster package and this docs http://django-raster.readthedocs.io/en/latest/tms.html here my code : models.py from django.contrib.gis.db import models class RasterWithName(models.Model): raster = models.RasterF

Re: Multi-threading with a simple timer?

2018-07-03 Thread Michael Vilain
The way I've done the "input with timeout" requirement the OP requested is dependent on the operating system. The current implementation of the input function doesn't offer that feature. https://docs.python.org/3/library/functions.html#input In another language, I used low-levelsystem calls to

Re: Multi-threading with a simple timer?

2018-07-03 Thread Akkana Peck
David D wrote: > Is there a SIMPLE method that I can have a TIMER count down at a user input > prompt - if the user doesn't enter information within a 15 second period, it > times out. Does this do what you want? from threading import Timer import sys import os def run_later(): print("Timed

Re: Getting posts to sort chronologically in tree view

2018-07-03 Thread Richard Damon
On 7/3/18 9:45 AM, Jim Lee wrote: > > > On 07/03/18 08:49, T Berger wrote: >> >>   It would help if my conversations showed up in my gmail, but they >> don't. I thought that would happen when I chose the "Automatically >> subscribe me to email updates when I post to a topic" option in the >> forum

Re: Getting posts to sort chronologically in tree view

2018-07-03 Thread Jim Lee
On 07/03/18 08:49, T Berger wrote: It would help if my conversations showed up in my gmail, but they don't. I thought that would happen when I chose the "Automatically subscribe me to email updates when I post to a topic" option in the forum settings. Am I wrong? And is there some way to

Re: Multi-threading with a simple timer?

2018-07-03 Thread David D
This works, but does not do exactly what I want. When the user enters in a correct answer, the program and threading stops. Any ideas on what I should change? import time from threading import Thread class Answer(Thread): def run(self): a=input("What is your answer:") if a=

Re: Multi-threading with a simple timer?

2018-07-03 Thread David D
This works, but does not do exactly what I want. What I want to happen is : when the user enters in a correct answer, the program and threading stops. Any ideas on what I should change? import time from threading import Thread class Answer(Thread): def run(self): a=input("What

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Jim Lee
On 07/03/18 06:32, Dennis Lee Bieber wrote: On Mon, 2 Jul 2018 19:51:29 -0500, Tim Daneliuk declaimed the following: Except that the current attempt is to use techniques like agile, scrum, pair programming, and so forth to turn programming into a factory activity. High degrees of specializa

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Grant Edwards
On 2018-07-03, Steven D'Aprano wrote: > On Tue, 03 Jul 2018 14:24:26 +, Grant Edwards wrote: >> On 2018-07-03, Dan Stromberg wrote: >> >>> I used to write useful programs that ran in 256 bytes of RAM. >> >> Me too. >> >> Less than 10 years ago. >> >> In a real product. >> >> That's still

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Jim Lee
On 07/03/18 01:34, Steven D'Aprano wrote: I said *indefinite* not infinite. Yes, you did.  My bad. You did read the article I linked to, right? You know that people don't suddenly and instantly turn from "beginner" to "expert" when they exceed 9,999 hours 59 minutes and 59 seconds? Quibblin

Re: File names with slashes [was Re: error in os.chdir]

2018-07-03 Thread Thomas Jollans
On 2018-07-03 14:06, Mikhail V wrote: > Greg wrote: > >> Mikhail V wrote: >>> s= "\"s\"" -> >>> s= {"s"} >> >> But now you need to find another way to represent set literals. > > > I need to find? That comment was not about (current) Python but > rather how I think string should have been

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Steven D'Aprano
On Tue, 03 Jul 2018 14:24:26 +, Grant Edwards wrote: > On 2018-07-03, Dan Stromberg wrote: > >> I used to write useful programs that ran in 256 bytes of RAM. > > Me too. > > Less than 10 years ago. > > In a real product. > > That's still shipping. Well don't be shy. Got a link? -- S

Re: Getting posts to sort chronologically in tree view

2018-07-03 Thread T Berger
On Monday, July 2, 2018 at 2:36:00 PM UTC-4, Dan Stromberg wrote: > On Mon, Jul 2, 2018 at 11:02 AM, T Berger wrote: > > > Is there any way to set posts to appear chronologically in tree view? And > > why is the tree view completely out of order? My last two posts in this > > view are from 6/27 a

Re: Multi-threading with a simple timer?

2018-07-03 Thread Chris Angelico
On Wed, Jul 4, 2018 at 12:05 AM, Marko Rauhamaa wrote: > Gregory Ewing : > >> Robin Becker wrote: >>> if I leave out the signal.signal(signal.SIGALRM,signal.SIG_IGN) then >>> the timeout function gets called anyway. >> >> Yes, it needs some more stuff around it to make it useful. Probably >> you a

Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-07-03 Thread Grant Edwards
On 2018-07-03, Grant Edwards wrote: > On 2018-07-03, Grant Edwards wrote: >> On 2018-07-01, Marko Rauhamaa wrote: >>> Gregory Ewing : >>> I don't see how the address-reuse timeout can be a security measure, because the process trying to take over the address can easily circumvent

Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-07-03 Thread Grant Edwards
On 2018-07-03, Grant Edwards wrote: > On 2018-07-01, Marko Rauhamaa wrote: >> Gregory Ewing : >> >>> I don't see how the address-reuse timeout can be a security measure, >>> because the process trying to take over the address can easily >>> circumvent it by setting SO_REUSEADDR. >> >> [...] >> >>

Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-07-03 Thread Grant Edwards
On 2018-07-01, Marko Rauhamaa wrote: > Gregory Ewing : > >> I don't see how the address-reuse timeout can be a security measure, >> because the process trying to take over the address can easily >> circumvent it by setting SO_REUSEADDR. > > [...] > > Nevertheless, the later socket object cannot un

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Gene Heskett
On Tuesday 03 July 2018 09:32:52 Dennis Lee Bieber wrote: > On Mon, 2 Jul 2018 19:51:29 -0500, Tim Daneliuk > > declaimed the following: > >Except that the current attempt is to use techniques like agile, > >scrum, pair programming, and so forth to turn programming into > >a factory activity. Hi

Re: Multi-threading with a simple timer?

2018-07-03 Thread Michael Vilain
Won't this code send a signal *regardless* of the user input to the process within 15 seconds. I don't see how it's tied to terminal input. From what I can tell, you need to create your own version of input with a timeout option. This doesn't do that. -- Michael Vilain 650-322-6755 > On 02-Jul

Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-07-03 Thread Marko Rauhamaa
Chris Angelico : > On Tue, Jul 3, 2018 at 10:26 PM, Marko Rauhamaa wrote: >> It's crucial that the killed party is the server for the situation to >> arise. >> >> That's why polite clients close their end of the connection before >> the server. Whoever closes first will suffer the TIME-WAIT state

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Grant Edwards
On 2018-07-03, Dan Stromberg wrote: > I used to write useful programs that ran in 256 bytes of RAM. Me too. Less than 10 years ago. In a real product. That's still shipping. -- Grant Edwards grant.b.edwardsYow! Are you mentally here at

Re: Multi-threading with a simple timer?

2018-07-03 Thread Marko Rauhamaa
Gregory Ewing : > Robin Becker wrote: >> if I leave out the signal.signal(signal.SIGALRM,signal.SIG_IGN) then >> the timeout function gets called anyway. > > Yes, it needs some more stuff around it to make it useful. Probably > you also want the signal handler to raise an exception and catch it >

Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-07-03 Thread Chris Angelico
On Tue, Jul 3, 2018 at 10:26 PM, Marko Rauhamaa wrote: > Gregory Ewing : > >> Marko Rauhamaa wrote: >>> Nevertheless, the later socket object cannot unilaterally take over a >>> socket using SO_REUSEADDR. The earlier socket object must have set the >>> same option previously. >> >> I just did an e

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Bart
On 01/07/2018 18:06, Abdur-Rahmaan Janhangeer wrote: was viewing pep526, so, finally, python cannot do without hinting the type as other languages? will python finally move to int x = 3 where int is a pre annotation? i am not arguing it's usefulness but rather, does it fit with python? Not in

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Chris Angelico
On Tue, Jul 3, 2018 at 6:34 PM, Steven D'Aprano wrote: > Or as my wife would say, "did you mean an Aussie couple or an actual > couple?" I meant an Aussie couple, which could be anything from two to > four or five. Six at a stretch. As in, "no worries mate, it'll be ready > in a coupla days." cf

Re: Multi-threading with a simple timer?

2018-07-03 Thread Gregory Ewing
Robin Becker wrote: if I leave out the signal.signal(signal.SIGALRM,signal.SIG_IGN) then the timeout function gets called anyway. Yes, it needs some more stuff around it to make it useful. Probably you also want the signal handler to raise an exception and catch it somewhere rather than exiting

Python 3.7 configuration issue

2018-07-03 Thread Robin Becker
On a Ubuntu trusty system I ran ./configure --prefix=/home/rptlab/PYTHON make && make install and get an error related to the ctypes module not being importable. I needed to do sudo apt-get install libffi-dev ./configure --prefix=/home/rptlab/PYTHON --with-system-ffi make && make install Som

Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-07-03 Thread Marko Rauhamaa
Gregory Ewing : > Marko Rauhamaa wrote: >> Nevertheless, the later socket object cannot unilaterally take over a >> socket using SO_REUSEADDR. The earlier socket object must have set the >> same option previously. > > I just did an experiment that suggests that's not the case. > I created a socket

File names with slashes [was Re: error in os.chdir]

2018-07-03 Thread Mikhail V
Greg wrote: > Mikhail V wrote: > > s= "\"s\"" -> > > s= {"s"} > > But now you need to find another way to represent set literals. I need to find? That comment was not about (current) Python but rather how I think string should have been from the beginning. So you already like it and want

ANN: Python Meeting Düsseldorf - 04.07.2018

2018-07-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

EuroPython 2018: Schedule available

2018-07-03 Thread M.-A. Lemburg
Over the last few weeks, our program WG has been working hard on getting the schedule all lined up. Today, we’re releasing it to the Python world. Schedule for EuroPython 2018 * https://ep2018.europython.eu/en/events/schedule/ * With 140 speakers and more than 150 s

Re: File names with slashes [was Re: error in os.chdir]

2018-07-03 Thread Gregory Ewing
Mikhail V wrote: s= "\"s\"" -> s= {"s"} But now you need to find another way to represent set literals. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Steven D'Aprano
On Mon, 02 Jul 2018 18:20:53 -0700, Jim Lee wrote: > On 07/02/18 17:51, Steven D'Aprano wrote: >> >> For most of us mere mortals, the "ten thousand hours" rule of thumb >> applies. >> >> Ten thousand hours should be read as an indefinitely large number >> >>> A truly good programmer will be able t

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Gregory Ewing
Steven D'Aprano wrote: "Jack of all trades, master of none" sort of thing? Or are you thinking more along the lines of one of those guys who masters a new language in an hour and reaches expert level in a week? I'm not talking about someone who hasn't mastered anything. I'm talking about some

Re: Multi-threading with a simple timer?

2018-07-03 Thread Robin Becker
On 03/07/2018 07:12, Gregory Ewing wrote: import signal, sys def timeout(*args): print("Too late!") sys.exit(0) signal.signal(signal.SIGALRM, timeout) signal.setitimer(signal.ITIMER_REAL, 15) data = input("Enter something: ") print("You entered: ", data) This doesn't work in windows

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Dan Stromberg
On Mon, Jul 2, 2018 at 5:51 PM, Tim Daneliuk wrote: > In particular, there is little interest in having programmers > learn on the job, only that they be as productive as possible > as fast they can. Hiring specific languages skills - the theory > goes - means that the individual will be fluent