minor clean-up
This commit is contained in:
parent
39534d11dd
commit
d0b8233c9a
|
|
@ -13,12 +13,7 @@ try:
|
||||||
_unpack_str = unpack
|
_unpack_str = unpack
|
||||||
pack = lambda x, *args: _pack_str(str(x), *args)
|
pack = lambda x, *args: _pack_str(str(x), *args)
|
||||||
unpack = lambda x, *args: _unpack_str(str(x), *args)
|
unpack = lambda x, *args: _unpack_str(str(x), *args)
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
|
||||||
unicode
|
|
||||||
# this is certanly Python 2
|
|
||||||
is_string = lambda d: isinstance(d, unicode) or isinstance(d, str)
|
is_string = lambda d: isinstance(d, unicode) or isinstance(d, str)
|
||||||
# no easy way to distinguish between b'' and '' :(
|
# no easy way to distinguish between b'' and '' :(
|
||||||
# or (isinstance(d, str) \
|
# or (isinstance(d, str) \
|
||||||
|
|
@ -30,6 +25,9 @@ except:
|
||||||
# In Py3, unicode and str are equal (the unicode object does not exist)
|
# In Py3, unicode and str are equal (the unicode object does not exist)
|
||||||
is_string = lambda d: isinstance(d, str)
|
is_string = lambda d: isinstance(d, str)
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
class NamedInt(int):
|
class NamedInt(int):
|
||||||
"""An reqular Python integer with an attached name.
|
"""An reqular Python integer with an attached name.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue