[Python-ideas] binding vs rebinding

Aahz aahz at pythoncraft.com
Fri Feb 6 15:44:30 CET 2009


On Fri, Feb 06, 2009, spir wrote:
>
> Probably most name rebindings rather express a lack of distinction
> that makes the code obscure. Haven't you ever read things like:
>
> config = "config.txt"	# string: name
> config = open(config)	# file object
> config = config.read()	# string: content
> config = config.lines()	# array of strings
> config = parse(config)	# e.g. custom object

Yup, I do that all the time.  I happen to like that style.  Your proposal
would break existing code, therefore it's not going to happen.  (Keep in
mind that even the 2.x to 3.x transition changed very little of Python's
semantic model.)
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Weinberg's Second Law: If builders built buildings the way programmers wrote 
programs, then the first woodpecker that came along would destroy civilization.



More information about the Python-ideas mailing list