diff options
author | Jeff Long <willcode4@gmail.com> | 2018-02-17 09:23:09 -0500 |
---|---|---|
committer | Marcus Müller <mueller@kit.edu> | 2018-02-21 19:42:46 +0100 |
commit | ef7d0da81af28c40ff29eb0a973076ddc5002885 (patch) | |
tree | 70376d2197116c9636961fe1b0f683778a943db1 /gnuradio-runtime/python/gnuradio/gr/gateway.py | |
parent | ba63bd46e3a79d4312a16d9d35f918aa4cfa67db (diff) |
python gateway: use tuples instead of lists where possible
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/gr/gateway.py')
-rw-r--r-- | gnuradio-runtime/python/gnuradio/gr/gateway.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gr/gateway.py b/gnuradio-runtime/python/gnuradio/gr/gateway.py index fe9a77bcc4..eb8f520af4 100644 --- a/gnuradio-runtime/python/gnuradio/gr/gateway.py +++ b/gnuradio-runtime/python/gnuradio/gr/gateway.py @@ -100,7 +100,7 @@ class py_io_signature(object): def port_types(self, nports): ntypes = len(self.__types) if ntypes == 0: - return [] + return () if nports <= ntypes: return self.__types[:nports] return self.__types + [self.__types[-1]]*(nports-ntypes) @@ -112,9 +112,9 @@ class gateway_block(object): def __init__(self, name, in_sig, out_sig, work_type, factor): - # Normalize the many Python ways of saying 'nothing' to '[]' - in_sig = in_sig or [] - out_sig = out_sig or [] + # Normalize the many Python ways of saying 'nothing' to '()' + in_sig = in_sig or () + out_sig = out_sig or () # Backward compatibility: array of type strings -> py_io_signature if type(in_sig) is py_io_signature: |