> bow = Ribbon(colour='yellow') > tie(bow, old_oak_tree) > for archer in troop: > let bow = get_weapon() > archer.take(bow) > assert bow.colour = 'yellow' >
I had just this problem yesterday, and on many other days. However, I don't think the opt-in block scoping would have done much to help. In my particular case, I had some geographic data in a file. It seemed like a name like 'geo_data' was a good way to refer to the filename with the data. Then it seemed like 'geo_data was a good way to refer to the file handle. Then it seemed like a name like 'geo_data' was a good way to refer to the DataFrame resulting from reading it. Then it seemed like 'geo_data' was a good way to refer to the reformatted data I created in memory. Then it seemed like 'geo_data' was a good name for the file handle to the new file I write in the new format. Naming things is hard. (I might have exaggerated the specific example). But not much of the problem had to do with scoping. I pretty much wanted to use all those different meanings in the same scope. And also not use absurdly long names like 'filehandle_for_json_geo_data'. Even if scoping *could* have separated all those uses, it would be kinda terrible code where that same name had all these different meanings nearby, even if in technically different scopes. -- The dead increasingly dominate and strangle both the living and the not-yet born. Vampiric capital and undead corporate persons abuse the lives and control the thoughts of homo faber. Ideas, once born, become abortifacients against new conceptions.
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/QSACNSJIQUGQVNQ5SET2VOGLXHSHKDAJ/ Code of Conduct: http://python.org/psf/codeofconduct/