Skip to content
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

Compatible with pydantic exporting model's method #1720

Closed
wants to merge 1 commit into from

Conversation

xl9211
Copy link

@xl9211 xl9211 commented Jul 16, 2020

No description provided.

@Kludex
Copy link
Member

Kludex commented Jul 17, 2020

@xl9211 Could you explain what you're doing exactly?

But anyhow, I've noticed that jsonable_encoders has a set() as default parameter, we should remove it:

Code snippet examplifying problem:

def func(a: int, param = set()):
    param.add(a)
    print(param)

func(1) # prints "{1}"
func(2) # prints "{1, 2}"

@tiangolo
Copy link
Member

tiangolo commented Aug 3, 2020

Thanks for your interest, it seems you are assuming Pydantic 1.x. I can't remove the backward-compatibility code until I deprecate Pydantic 0.32.0.

I should do that soon, but this can't be done before that.

So I'll pass on this for now. Thanks for your effort! 🍰 ☕

@tiangolo tiangolo closed this Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants