![](https://secure.gravatar.com/avatar/351a10f392414345ed67a05e986dc4dd.jpg?s=120&d=mm&r=g)
April 8, 2016
1:25 p.m.
We have abstract base classes for such tests, but there's nothing which would define "string-like" as ABC. Before trying to define a test via a special method, I think it's better to define what exactly you mean by "string-like".
Something along the lines of numbers.Number, but for strings.
To make an object string-like, you then test for the ABC and then call .__str__() to get the string representation as string.
Does ABC is easy to use from C? There should be easy way to (1) define "string-like" class in C and (2) use "string-like" object from C.