Re: Fwd: Sorry, but . . .

2020-04-28 Thread Michael Torrie
On 4/28/20 2:41 PM, Ganesha Sharma wrote: > When I was installing Python 3.8.2, The installer gave me a BSoD. Is there > a way to fix that? I tried 3.6.2 but with Add to Path, with > environment variables off, it did not work. I just want the full Python, > but can you ask the developers to fix tha

Fwd: Sorry, but . . .

2020-04-28 Thread Ganesha Sharma
-- Forwarded message - From: Ganesha Sharma Date: Sat, Apr 18, 2020 at 8:00 AM Subject: Sorry, but . . . To: When I was installing Python 3.8.2, The installer gave me a BSoD. Is there a way to fix that? I tried 3.6.2 but with Add to Path, with environment variables off, it did n

Re: Bug in the urljoin library

2020-04-28 Thread Peter Otten
Moro, Andrea via Python-list wrote: > Hello there, > > I believe there is a bug in the urljoin library. I believe this is a case of garbage-in garbage-out ;) Try p = urlparse(url) if not p.scheme: url = urlunparse(p._replace(scheme="http")) > > See below: > > p = urlparse(url) > if p.sc

Bug in the urljoin library

2020-04-28 Thread Moro, Andrea via Python-list
Hello there, I believe there is a bug in the urljoin library. See below: p = urlparse(url) if p.scheme == '': url = urljoin('http://', url) Input: domain.tld/somepath Output http:///domain.tld/somepath p = urlparse(url) if p.scheme == '': url = urljoin('http:', url) Input: domain.tld/somepa

[RELEASE] Python 3.9.0a6 is now available for testing

2020-04-28 Thread Łukasz Langa
On behalf of the entire Python development community, and the currently serving Python release team in particular, I’m pleased to announce the release of Python 3.9.0a6. Get it here: https://www.python.org/downloads/release/python-390a6/

Re: JH Conway memorial Life program

2020-04-28 Thread ast
Le 12/04/2020 à 23:40, Paul Rubin a écrit : You might have heard by now that John Horton Conway died yesterday at age 82, of complications from the SARS-Cov2 aka Corona virus. Among his many cool accomplishments was inventing the Game of Life, which was one of my first exercises as a beginning p

Re: Conway's game of Life, just because.

2020-04-28 Thread ast
Le 07/05/2019 à 05:31, Paul Rubin a écrit : #!/usr/bin/python3 from itertools import chain def adjacents(cell):# generate coordinates of cell neighbors x, y = cell # a cell is just an x,y coordinate pair return ((x+i,y+j) for i in [-1,0,1] for j in [-1,0,1]

Re: Function to avoid a global variable

2020-04-28 Thread Christian Gollwitzer
Am 28.04.20 um 09:54 schrieb ast: funny ! So we found 4 different ways to handle a memory in a function 1- Use a function parameter with a mutable default value 2- Use a function attribute 3- Use a callable object, and store your stuff inside an object attr 4- Use a closure to emulate a stat

Re: Function to avoid a global variable

2020-04-28 Thread ast
Le 28/04/2020 à 09:52, ast a écrit : Le 28/04/2020 à 09:39, Antoon Pardon a écrit : Op 27/04/20 om 18:39 schreef Bob van der Poel: Thanks Chris! At least my code isn't (quite!) as bad as the xkcd example :) Guess my "concern" is using the initialized array in the function:     def myfunct(

Re: Function to avoid a global variable

2020-04-28 Thread ast
Le 28/04/2020 à 09:39, Antoon Pardon a écrit : Op 27/04/20 om 18:39 schreef Bob van der Poel: Thanks Chris! At least my code isn't (quite!) as bad as the xkcd example :) Guess my "concern" is using the initialized array in the function:     def myfunct(a, b, c=array[0,1,2,3] ) always feels

Re: Function to avoid a global variable

2020-04-28 Thread Antoon Pardon
Op 27/04/20 om 18:39 schreef Bob van der Poel: Thanks Chris! At least my code isn't (quite!) as bad as the xkcd example :) Guess my "concern" is using the initialized array in the function: def myfunct(a, b, c=array[0,1,2,3] ) always feels like an abuse. Has anyone seriously considere

Re: Function to avoid a global variable

2020-04-28 Thread Chris Angelico
On Tue, Apr 28, 2020 at 5:26 PM ast wrote: > > Le 28/04/2020 à 09:13, Chris Angelico a écrit : > > On Tue, Apr 28, 2020 at 4:56 PM ast wrote: > >> > >> Le 27/04/2020 à 04:46, Bob van der Poel a écrit : > > > > > > "Best"? Not sure about that. Functions are first-class objects in > > Python, so a

Re: Function to avoid a global variable

2020-04-28 Thread ast
Le 28/04/2020 à 09:13, Chris Angelico a écrit : On Tue, Apr 28, 2020 at 4:56 PM ast wrote: Le 27/04/2020 à 04:46, Bob van der Poel a écrit : "Best"? Not sure about that. Functions are first-class objects in Python, so a function *is* a callable object. You don't have to create a custom cl

Re: Function to avoid a global variable

2020-04-28 Thread Chris Angelico
On Tue, Apr 28, 2020 at 4:56 PM ast wrote: > > Le 27/04/2020 à 04:46, Bob van der Poel a écrit : > > Does this make as much sense as anything else? I need to track calls to a > > function to make sure it doesn't get called to too great a depth. I had a > > global which I inc/dec and then check in

Re: Function to avoid a global variable

2020-04-28 Thread ast
Le 28/04/2020 à 08:51, ast a écrit : Le 27/04/2020 à 04:46, Bob van der Poel a écrit : Does this make as much sense as anything else? I need to track calls to a function to make sure it doesn't get called to too great a depth. I had a global which I inc/dec and then check in the function. Works