[Python-Dev] A wart which should have been repaired in 3.0?

Antoine Pitrou solipsis at pitrou.net
Sat Dec 27 21:59:28 CET 2008


Nick Coghlan <ncoghlan <at> gmail.com> writes:
> 
> The current behaviour is exactly what one would need to implement
> bash-style tab completion [1], so I don't get why anyone is calling it
> "useless" or "obviously broken".

Point taken. 
Although the fact that it lives in os.path suggests that the function should
know about path components instead of ignoring their existence... A generic
longest common prefix function would belong elsewhere.

The issue people are having with the proposal to create a separate function is
that it's a bloat of the API. I don't think the os.path module claims to give
utilities for implementing bash-style tab completion, however it is supposed to
make manipulation of paths easier -- which returning invalid answers (or, worse,
valid but intuitively wrong answers) does not.




More information about the Python-Dev mailing list