pySQLite Insert speed
Peter Otten
__peter__ at web.de
Tue Mar 4 09:15:15 EST 2008
Steve Holden wrote:
> What I will repeat, however, is that while there is a *slight*
> difference is semantics between
>
> s = "some string"
> s1 = s
>
> and
>
> s = "some string"
> s1 = copy.copy(s)
>
> that difference is only to ensure that s and s1 point to different
> copies of the same string in the latter case, whereas in the former case
> s and s1 point to the same string.
No, both "point" to the same string:
>>> import copy
>>> s = "some string"
>>> s1 = s
>>> s1 is s
True
>>> s2 = copy.copy(s)
>>> s2 is s
True
copy.copy() is just an expensive no-op here.
Peter
More information about the Python-list
mailing list