-
Notifications
You must be signed in to change notification settings - Fork 38
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
[Bug] from __future__ import annotations #26
Labels
bug
Something isn't working
Comments
Hello jmolinsky. This looks serious, thank you for reporting it. |
This has been solved in 0.8.4. |
AddressXception
added a commit
to Election-Tech-Initiative/electionguard-python
that referenced
this issue
May 4, 2020
__future__ annotations is causing the json serialization to fail. annotations are necessary to support fluent interface typing for methods on class instances which return their encapsulating type. see: ramonhagenaars/jsons#26 and ramonhagenaars/jsons#100 until this is fixed, the builder pattern must exist in it's own file
AddressXception
added a commit
to Election-Tech-Initiative/electionguard-python
that referenced
this issue
May 7, 2020
* 📝 Add VSCode Recommended Extensions Add recommendations to ensure users know to install python tools. * 🧹 Configure VSCode Formatting & Linting Settings - Enable pylint settings and mypy type checking - Set the formatting to rely on black * ✅ Configure Pytest for VS Code __init__ is necessary to ensure tests are run properly. * 🔧Configure Github PR Workflow 🔧Configure MyPy to match tox file 🔧Add Black Configuration 🔧Update Pylint configuration * 📝Update Readme for first time users - Isolate Contributing file - Update Readme with usable dev steps * ✨MacOS Workflow * 🧹 Add Dev Lint Dependencies to Pipfile 🛠 Allow Prerelease for Black * 🔧 Add Linting Bypass and Adjustments to MyPy - MyPy check is silly and needs to have direct directories and files - Due to errors with last PR some pieces need to temporarily be bypassed. * Add InternalElectionDescription generate placeholders for contests when the election is set up. Use a builder pattern for setting up an election. * rename Election to ElectionDescription * Move Election builder to its own file __future__ annotations is causing the json serialization to fail. annotations are necessary to support fluent interface typing for methods on class instances which return their encapsulating type. see: ramonhagenaars/jsons#26 and ramonhagenaars/jsons#100 until this is fixed, the builder pattern must exist in it's own file * clean up mypy, move proof generation to class objects * add decrypt contest and decrypt ballot methods * Create ObjectBase * decrypt using derivative nonce seeds for the ballot when decrypting, allow the consumer to specify the nonce seed to use when generating the nonce for decrypting selections. * proofs are optional on cyphertext resources add a few missing tests * remove contest file * migrate optional handlers to .utils * update extended data field * allow nonce values to be null on cyphertext ballot elements * rename election builder * nonce seed to elementmodq * rename election object base * provide context for integer params Co-authored-by: Keith Fung <keith.fung@infernored.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
from __future__ import annotations
literally destroys the library.Quick example:
foo.py
bar.py
Expected result:
[Baz(qux=0, spam=Spam(eggs=1))]
Result:
If you remove
from __future__ import annotations
fromfoo.py
everything works as expected.https://www.python.org/dev/peps/pep-0563/
from __future__ import annotations
stops the interpreter from executing type annotations, they are stored as str instead. Types may be revealed during runtime usingtyping.get_type_hints()
. This is going to be the default behavior in python4.The text was updated successfully, but these errors were encountered: