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

if a default_setter has a field argument pass the field name to that … #314

Closed
wants to merge 1 commit into from

Conversation

harvimt
Copy link

@harvimt harvimt commented May 28, 2017

…argument

attempt to resolve #279

@funkyfuture
Copy link
Member

thanks for addressing the issue. imo however, we need a generalized approach (alike dependency_injection), that could then be re-used in several parts of the library's code and extensions.

if it's agreed to include such funtionality, it should be merged after a 1.2 release. it adds complexity, opens new opportunies and should thus be tested broadly by the community.

@nicolaiarocci
Copy link
Member

Yes, I'm going to release 1.2, then you guys can start working on this. Thanks @harvimt for starting work on the feature.

@funkyfuture
Copy link
Member

btw, i recently made use of such mechanics in inxs. it actually is pretty straight-forward and fun to use. however we must be aware that it adds some overhead. also, would we implement our own inspection or use the package mentioned above? i tend to the first option.

@harvimt
Copy link
Author

harvimt commented Jul 4, 2017 via email

@funkyfuture
Copy link
Member

funkyfuture commented Sep 30, 2017

yes, inspect is a stdlib module. but comfortable signature inspection has been added with Python 3.3. as Python 2 is still supported by cerberus, we'd have to implement that part too.

meh, forget it, getfullargspec should be sufficient as type annotations are not relevant for this use-case.

why would you "write your own inspection"?

i actually meant 'injection'! :-/

this could be an opportunity to start a discussion and layout a maintenance plan of future versions with regard to Python 2. in a seperate issue, @nicolaiarocci what do you think, shall i draft a rough sketch to start this?

@nicolaiarocci
Copy link
Member

this could be an opportunity to start a discussion and layout a maintenance plan of future versions with regard to Python 2. in a seperate issue, @nicolaiarocci what do you think, shall I draft a rough sketch to start this?

Yes.

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.

Default setter needs to know the field name
3 participants