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
create_model support generics model #3946
Conversation
please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I wonder if this could have any unintended side effects?
I am not sure. but we need a rebase here to properly handle please update |
I try to extract code from this is source code in python3.8 official library def new_class(name, bases=(), kwds=None, exec_body=None):
resolved_bases = resolve_bases(bases)
meta, ns, kwds = prepare_class(name, resolved_bases, kwds)
if exec_body is not None:
exec_body(ns)
if resolved_bases is not bases:
ns['__orig_bases__'] = bases
return meta(name, resolved_bases, ns, **kwds) I'm alse not sure |
Thanks @hot123s for the explanations. Please consider you need to rebase your patch first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! IMO it's ok to add this in v1.10
c088109
to
d51585c
Compare
@hramezani I have rebased my branch, and compatible with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hot123s 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise LGTM.
Thanks so much. |
See #4432 related workaround which I think is required due to this PR. |
Change Summary
create_model support generics model
Related issue number
fix #3945
Checklist
changes/<pull request or issue id>-<github username>.md
file added describing change(see changes/README.md for details)