C
Claudiu Popa
Hello Python-list,
I have an object which defines some methods. I want to join a list or
an iterable of those objects like this:
new_string = "|".join(iterable_of_custom_objects)
What is the __magic__ function that needs to be implemented for
this case to work? I though that __str__ is sufficient but it doesn't seems to
work. Thanks in advance.
PC
I have an object which defines some methods. I want to join a list or
an iterable of those objects like this:
new_string = "|".join(iterable_of_custom_objects)
What is the __magic__ function that needs to be implemented for
this case to work? I though that __str__ is sufficient but it doesn't seems to
work. Thanks in advance.
PC