Re: [Python-Dev] String concatenation

2008年8月03日 11:30:05 -0700

Tres Seaver <tseaver <at> palladion.com> writes:
> 
> -1. The feature exists to allow adherence to PEP-8, "Limit all lines to
> a maximum of 79 characters.", without requiring runtime concatenation
> costs. I use it frequently when assembling and testing message strings,
> for instance.
In many cases there is no runtime concatenation cost.
>>> def f():
... return "first" + "second"
... 
>>> import dis
>>> dis.dis(f)
 2 0 LOAD_CONST 3 ('firstsecond')
 3 RETURN_VALUE 
Regards
Antoine.
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to