mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 17:05:35 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user