[Python-ideas] Add list.join() please

Jimmy Girardet ijkl at netc.fr
Wed Jan 30 06:18:08 EST 2019


At the end this long thread because 2 functions doing quite the same
thing have the same name but not the same signature and it's confusing
for some people (I'm one of those)


|os.path.||join|(/path/, /*paths/)

There are strong arguments about why it's implemented like that and why
it's very difficult to change it.

Maybe some change could be giving str.join 1 iterable or many args :
about str.join:
   a - if 0 arg : error
   b - if 1 arg : process or return error if not iterable
   c - if > 1 arg: do b using all args as one iterable

maybe some performance issues could go against it.

I agree with the fact that this is a minor need and it should not allow
major change
Le 30/01/2019 à 11:01, Jamesie Pic a écrit :
> I'm not disagreeing by any mean. I'm just saying assembling strings is
> a common programing task and that we have two different methods with
> the same name and inconsistent signatures and that it's error-prone.
> I'm most certainly *not* advocating for breaking compatibility or
> whatnot.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190130/4435c233/attachment.html>

More information about the Python-ideas mailing list