Lawrence D'Oliveiro <[email protected]d> writes:
Consider a function taking two args “a” and “b”, which can be of str,
bytes or bytearray type, just so long as both are of the same type.
One easy way to test this is
if type(a)==type(b) and type(a) in (str, bytes, bytearray): ...
Consider a function taking two args “a” and “b”, which can be of str, bytes or bytearray type, just so long as both are of the same type.
One easy way to test this is
Actually, both “and’ and “or” will work.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 05:09:22 |
| Calls: | 12,100 |
| Calls today: | 8 |
| Files: | 15,003 |
| Messages: | 6,517,905 |
| Posted today: | 1 |