Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

Thomas Passin list1 at tompassin.net
Wed Mar 6 08:16:01 EST 2024


On 3/6/2024 5:59 AM, Alan Gauld via Python-list wrote:
> On 05/03/2024 22:46, Grant Edwards via Python-list wrote:
>> Unfortunately (presumably thanks to SEO) the enshittification of
>> Google has reached the point where searching for info on things like
>> Python name scope, the first page of links are to worthless sites like
>> geeksforgeeks.
> And not just Google, I just tried bing, yahoo and duckduckgo
> and they are all the same. Not a one listed anything from
> python.org on the first page... In fact it didn't even appear
> in the first 100 listings, although wikipedia did manage an
> entry, eventually.

I don't know ... I just searched for "python local vs global variables" 
and a python.org page on it was the second hit. I usually use StartPage 
- who knows where they aggregate from - but the same search on Google 
and Bing also popped up the python.org link as the second hit.  As usual 
Bing was a nasty experience, though.

Still, if your search phrase isn't as well focused as that or you are 
less lucky, for sure you'll get all sorts of junk.



More information about the Python-list mailing list