New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace assigned lambdas with functions #651
Comments
Another thought that occurred to me is that functions can be split to be single-dispatch functions (though it may be an overkill in this case): The upside is that it would remove the need to implement single dispatch manually via |
Good point, lambdas are also a bit slower than function definitions. I don't really see the point of using |
As far as performance goes we can play it safe here and not use |
I see old round is used only in one place. Looks like it can be removed. Is the functionality of it still needed? |
Another thing I can think about is whether the lambdas are even needed. The conversation of Tribler/tribler#5023 made me think whether they're necessary. |
This concerns the blockchain block format. In the past, we used to serialize and unserialize the block itself before checking its signature. Now that we no longer do this, it should be fine to remove the old round. I don't believe any of our upstream projects use this either. |
Well, strictly speaking, |
I agree. |
Oh, I mean which functionality is necessary. For example in the PR I mentioned it turned out the functionality of
Seems like mainly anydex uses it, and Tribler in one of the tests. At least from a short check with ripgrep. Should |
Yes; I believe that is safe to do now. |
I'll open parallel issues in |
Since the parallel issues are in favor of removing |
Closed by #652 |
Platform
All; asyncio branch;
https://github.com/Tribler/py-ipv8/blob/asyncio/ipv8/util.py#L12
Expected behavior
Write functions instead of lambdas.
Actual behavior
Lambdas are assigned to variables, mooting the point of having them as "anonymous" functions.
Instead of
They can be instead written as
The text was updated successfully, but these errors were encountered: