objstr: Make *strip() accept bytes.

This commit is contained in:
Paul Sokolovsky
2014-05-11 13:17:29 +03:00
parent ce6c10172b
commit b2d4fc06fc
2 changed files with 16 additions and 3 deletions

View File

@@ -10,3 +10,13 @@ print('www.example.com'.lstrip('cmowz.'))
print(' spacious '.rstrip())
print('mississippi'.rstrip('ipz'))
print(b'mississippi'.rstrip(b'ipz'))
try:
print(b'mississippi'.rstrip('ipz'))
except TypeError:
print("TypeError")
try:
print('mississippi'.rstrip(b'ipz'))
except TypeError:
print("TypeError")