Removes unused functions and test bag application to iterables.
This commit is contained in:
@ -108,4 +108,4 @@ class Configurable(metaclass=ConfigurableMeta):
|
||||
return self.call(*args, **kwargs)
|
||||
|
||||
def call(self, *args, **kwargs):
|
||||
raise NotImplementedError('Not implemented.')
|
||||
raise AbstractError('Not implemented.')
|
||||
|
||||
@ -65,12 +65,8 @@ class Bag:
|
||||
if len(args) == 0 and len(kwargs) == 0:
|
||||
try:
|
||||
iter(func_or_iter)
|
||||
|
||||
def generator():
|
||||
nonlocal func_or_iter
|
||||
for x in func_or_iter:
|
||||
yield x
|
||||
|
||||
yield from func_or_iter
|
||||
return generator()
|
||||
except TypeError as exc:
|
||||
raise TypeError('Could not apply bag to {}.'.format(func_or_iter)) from exc
|
||||
|
||||
@ -1,31 +1,7 @@
|
||||
import functools
|
||||
import struct
|
||||
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
|
||||
def is_platform_little_endian():
|
||||
""" am I little endian """
|
||||
return sys.byteorder == 'little'
|
||||
|
||||
|
||||
def is_platform_windows():
|
||||
return sys.platform == 'win32' or sys.platform == 'cygwin'
|
||||
|
||||
|
||||
def is_platform_linux():
|
||||
return sys.platform == 'linux2'
|
||||
|
||||
|
||||
def is_platform_mac():
|
||||
return sys.platform == 'darwin'
|
||||
|
||||
|
||||
def is_platform_32bit():
|
||||
return struct.calcsize("P") * 8 < 64
|
||||
|
||||
|
||||
def deprecated_alias(alias, func):
|
||||
@functools.wraps(func)
|
||||
def new_func(*args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user