appendpath deprecated

John Arbash Meinel john at arbash-meinel.com
Fri Jun 30 22:20:55 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron Bentley wrote:
> John Arbash Meinel wrote:
>>> Whoever wrote appendpath() didn't realize this. Or maybe it changed with
>>> python 2.4. But we require 2.4 anyway.
> 
> Speaking of this, what's the deal with osutils.splitlines?  Isn't it the
> same thing as str.splitlines(True) ?
> 
> Aaron

looks like it to me.
I know there may be some edge cases, like if the string is empty, or
contains a single newline, etc.
Just because I know that split() versus splitlines() handle trailing
newlines differently.

>>> ''.splitlines()
[]
>>> ''.splitlines(True)
[]
>>> ''.split()
[]
>>> ''.split('\n')
['']

The crummy one is that last one. So if you split a string and pass a
parameter, it won't return the empty list for an empty string. While all
the others do.

There are a few callers of it. So we can't just remove it, but probably
we should find out if any difference is intentional or accidental.

Martin wrote the original split_lines a long time ago, and it seems
Robert updated it in April (probably as part of profiling Knits).

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEpZW3JdeBCYSNAAMRAi50AKCxCr8g0+rM/V+MzrDatXl/Obo7TwCgu0Rr
uq+VzRLHUGcDY2QTNcDgGr0=
=GPpb
-----END PGP SIGNATURE-----




More information about the bazaar mailing list