MAINT: Remove type checking which trip up Python 3 compatibility.

Instead of porting these cases of type checking, remove them instead.
Slightly more Python-ic to be more generous in what is allowed, and
the conversion to make these compatible with Python 3 are more trouble
than they are worth.
This commit is contained in:
Eddie Hebert
2014-01-06 11:32:10 -05:00
parent 68b78a6914
commit 045e2975b7
2 changed files with 0 additions and 7 deletions
-4
View File
@@ -39,7 +39,6 @@ def hash_args(*args, **kwargs):
def assert_datasource_protocol(event):
"""Assert that an event meets the protocol for datasource outputs."""
assert isinstance(event.source_id, basestring)
assert event.type in DATASOURCE_TYPE
# Done packets have no dt.
@@ -61,17 +60,14 @@ def assert_trade_protocol(event):
def assert_datasource_unframe_protocol(event):
"""Assert that an event is valid output of zp.DATASOURCE_UNFRAME."""
assert isinstance(event.source_id, basestring)
assert event.type in DATASOURCE_TYPE
def assert_sort_protocol(event):
"""Assert that an event is valid input to zp.FEED_FRAME."""
assert isinstance(event.source_id, basestring)
assert event.type in DATASOURCE_TYPE
def assert_sort_unframe_protocol(event):
"""Same as above."""
assert isinstance(event.source_id, basestring)
assert event.type in DATASOURCE_TYPE
-3
View File
@@ -17,7 +17,6 @@
"""
Generator versions of transforms.
"""
import types
import logbook
@@ -92,8 +91,6 @@ class StatefulTransform(object):
Otherwise only dt, tnfm_id, and tnfm_value are forwarded.
"""
def __init__(self, tnfm_class, *args, **kwargs):
assert isinstance(tnfm_class, (types.ObjectType, types.ClassType)), \
"Stateful transform requires a class."
assert hasattr(tnfm_class, 'update'), \
"Stateful transform requires the class to have an update method"