-
Notifications
You must be signed in to change notification settings - Fork 111
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
Box recast meaning #153
Comments
Can you give me an example of how that would be used so I understand what you want to accomplish with it? |
First I would like to stress that may remark/suggestion is about widening the meaning - not changing the code. Box(..., box_recast={'name': lambda x: x.title(), ...}) So, technically, one can use that already now, right? |
I have updated to 5.0.1 and this extended behavior is not working anymore. def __recast(self, item, value):
if self._box_config["box_recast"] and item in self._box_config["box_recast"]:
try:
if issubclass(self._box_config["box_recast"][item], (Box, box.BoxList)): Is that your design decision to forbid extended interpretation of recasting as discussed above? |
That was actually added to fix another issue being experienced, and of course didn't have the above test case to see how that would affect that ability. I will look into if it is possible to have it work as needed as it currently stands, as well as the above code, or if they would need to be separate things. |
Don't you think we can expand the meaning of the
box_recast
and consider it as a more generic mapping operation, that iswhere the
callable
could be a type or any other callable object returning a value?It seems nothing prevents such interpretation already, right?
Thanks
The text was updated successfully, but these errors were encountered: