Skip to content

✨ Use of var-args makes translation to other languages difficult #446

@axman6

Description

@axman6

Is there an existing issue for this?

  • I have searched the existing issues

Suggestion

There seems to be some inconsistent use of varargs in a few places that make the translation to other languages more difficult than it needs to be. The example I've come across is https://github.com/microsoft/electionguard-python/blob/main/src/electionguard/ballot.py#L757 which has the lines

        contest_hashes = [contest.crypto_hash for contest in self.contests]
        return hash_elems(self.object_id, encryption_seed, *contest_hashes)

Possible Implementation

The code above could easily just be simply

        contest_hashes = [contest.crypto_hash for contest in self.contests]
        return hash_elems(self.object_id, encryption_seed, contest_hashes)

which should achieve the same outcome but make translations easier when languages don't have things like heterogeneous lists. In my Haskell implementation, hashes of multiple arguments of differerent are represented using the instances for various tuple types, so I can't generate a tuple of arbitrary size at runtime.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthacktoberfestIssues for the Hacktoberfesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions