2016-08-07 20:14:34 +01:00
|
|
|
try:
|
|
|
|
str.partition
|
|
|
|
except AttributeError:
|
|
|
|
print("SKIP")
|
2017-06-10 18:03:01 +01:00
|
|
|
raise SystemExit
|
2016-08-07 20:14:34 +01:00
|
|
|
|
2014-03-18 07:06:29 +00:00
|
|
|
print("asdf".partition('g'))
|
|
|
|
print("asdf".partition('a'))
|
|
|
|
print("asdf".partition('s'))
|
|
|
|
print("asdf".partition('f'))
|
|
|
|
print("asdf".partition('d'))
|
|
|
|
print("asdf".partition('asd'))
|
|
|
|
print("asdf".partition('sdf'))
|
|
|
|
print("asdf".partition('as'))
|
|
|
|
print("asdf".partition('df'))
|
|
|
|
print("asdf".partition('asdf'))
|
|
|
|
print("asdf".partition('asdfa'))
|
|
|
|
print("asdf".partition('fasdf'))
|
|
|
|
print("asdf".partition('fasdfa'))
|
|
|
|
print("abba".partition('a'))
|
|
|
|
print("abba".partition('b'))
|
|
|
|
|
|
|
|
try:
|
|
|
|
print("asdf".partition(1))
|
|
|
|
except TypeError:
|
|
|
|
print("Raised TypeError")
|
|
|
|
else:
|
|
|
|
print("Did not raise TypeError")
|
|
|
|
|
|
|
|
try:
|
|
|
|
print("asdf".partition(''))
|
|
|
|
except ValueError:
|
|
|
|
print("Raised ValueError")
|
|
|
|
else:
|
|
|
|
print("Did not raise ValueError")
|
2014-05-11 00:44:46 +01:00
|
|
|
|
|
|
|
# Bytes
|
|
|
|
print(b"abba".partition(b'b'))
|
|
|
|
try:
|
|
|
|
print(b"abba".partition('b'))
|
|
|
|
except TypeError:
|
|
|
|
print("Raised TypeError")
|
|
|
|
try:
|
|
|
|
print("abba".partition(b'b'))
|
|
|
|
except TypeError:
|
|
|
|
print("Raised TypeError")
|