News for hackers. Stuff that matters.
Re:Test for lists in Cython by nostoc on Monday April 19, 2021 @09:24AM (#26862468)
That's not a failure of OOP, but a failure of design.

This could have easily been avoided if `join` would have been a method of the list object, not the string object. But we're stuck with this now.

Re:Test for lists in Cython by duckerude on Monday April 19, 2021 @11:24AM (#26863774)
If join were a method on lists then you wouldn't be able to use it with other iterables. Putting it on str is more useful, if more confusing.

Maybe it would be better as a standalone function. But then you'd either have to import it or it would pollute the global namespace.

Other OOP models offer different solutions.

Re:Test for lists in Cython by leephillips on Monday April 19, 2021 @11:40AM (#26863992)
The Julia join function works on any iterable whose members are or can be converted into strings.
Re:Test for lists in Cython by adgjlsfhk1 on Monday April 19, 2021 @03:07PM (#26866734)
That requires multiple dispatch.