3 ms·
string.join(ary, ', ') # python - ok: join ary with a str The parameters to Python's join function are in a better order than Perl's. This is expected since
by mleonhard 18y ago
string.join(ary, ', ') # python - ok: join ary with a str
The parameters to Python's join function are in a better order than Perl's. This is expected since Perl perverts the concept of function arity.
Also, twisted is not an example of the best Python code.
- zenspider 18y agoyes, they did add that form after a while... (so much for one right way to do things, eh?). It seems that people still prefer the `sep.join(ary)` form more based on the code reading/debugging I've done. "better order" is subjective and I have to disagree in this case. perl's form isn't limited like pythons as it takes any number of values after the separator. Much like ruby's "* arg" (splat arg--HN's formatting is besting me) or lisp's &rest. Lisp's (+ ...), (< ...), etc are lovely because of this property. Twisted is an example of some of the most popular python code out there... It is representative of real world python and is what drives me away from the language (and has me running screaming away from twisted).