WikibaseIntegrator
WikibaseIntegrator copied to clipboard
Use pydantic?
"Data validation and settings management using python type annotations.
pydantic enforces type hints at runtime, and provides user friendly errors when data is invalid.
Define how data should be in pure, canonical python; validate it with pydantic."
https://pydantic-docs.helpmanual.io/
https://medium.com/swlh/cool-things-you-can-do-with-pydantic-fc1c948fbde0#f078 is a good introduction, I just implemented it in asseeibot and it was some work, but it seems to be worth it :)
I ran into this error after adding pydantic in https://github.com/dpriskorn/WikibaseIntegrator/tree/pydantic-test
I searched the interwebbs but did not find anything about this issue. Might be an issue in pydantic?
Unfortunately pydantic does not seem to support private variables and setters. See https://stackoverflow.com/questions/69152143/private-attributes-in-pydantic
Should we close this and so our own validation instead?