Check whether obj behaves like a string.
(obj)
| 35 | |
| 36 | |
| 37 | def _is_string_like(obj): |
| 38 | """ |
| 39 | Check whether obj behaves like a string. |
| 40 | """ |
| 41 | try: |
| 42 | obj + '' |
| 43 | except (TypeError, ValueError): |
| 44 | return False |
| 45 | return True |
| 46 | |
| 47 | |
| 48 | def _is_bytes_like(obj): |
no outgoing calls
no test coverage detected