Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pydantic, would it be worthwhile for us to use it?#1672

JohnVillalovos started this conversation inIdeas
Discussion options

Usingpydantic would seem to be a good fit for python-gitlab as it helps to check that the data we are receiving is what we expect to receive.

Any thoughts on start using pydantic in the code base?

https://pydantic-docs.helpmanual.io/

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

nejch
Nov 7, 2021
Maintainer

If I get it right from a quick glance, this would mostly be a drop-in and we'd just need to extendBaseModel most of the time to get runtime validation?

If so, would it be an option to add it toextra_requires as a start - and have it as apip install python-gitlab[pydantic] option for people who'd like to have this? We'd just need some convenient try/except import somewhere, I assume, with a dummy/fallbackBaseModel object or so.

You must be logged in to vote
1 reply
@JohnVillalovos
Comment options

JohnVillalovosNov 7, 2021
Maintainer Author

I don't think it would be an "optional" thing. It would be a library we start using to help with data validation.

It would be overly complicated if we had multiple classes doing the same thing. One with pydantic support and one without. IMHO.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
2 participants
@JohnVillalovos@nejch

[8]ページ先頭

©2009-2025 Movatter.jp