[riot-notifications] [RIOT-OS/RIOT] sys/net/dhcpv6: Refactor IA_NA implementation (#16724)

Jan Romann notifications at github.com
Thu Aug 12 01:49:06 CEST 2021

@JKRhb commented on this pull request.

> +    result = [
+        (addr, prefix) for addr, prefix in test_data if test_function(addr, prefix)
+    ]
+    assert len(result) == 1

I originally intended to use something like this:

def perform_test(test_data, test_function):
    """Assert that only one address matches the given test function"""
    assertion = lambda address, prefix: test_function(address, prefix)
    result = filter(assertion, test_data)
    assert len(result) == 1

But I am not sure if a lambda function is very readable either.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210811/1ec9ebed/attachment.htm>

More information about the notifications mailing list