You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# TODO: Raise exception if field_name already in fields
This is in the method which resolves the field types and the comment is about checking if a field with the same name already exists.
I opened this discussion to argue against the addition of such exception.
Adding the exception would mean, that it would be impossible to override fields from inherited classes.
E.g. the following example would not work:
This example demonstrates a use case where a user can read and add notes with as few code duplication as possible.
To have the correct types for image, we must override it depending on the type of the class (i.e. type or input).
Thus I would recommend not adding such exception or allow disabling it. (Another option might be a disallowable option.)
I hope I didn't oversee anything why above example is a bad idea.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I came across this comment in the code:
This is in the method which resolves the field types and the comment is about checking if a field with the same name already exists.
I opened this discussion to argue against the addition of such exception.
Adding the exception would mean, that it would be impossible to override fields from inherited classes.
E.g. the following example would not work:
This example demonstrates a use case where a user can read and add notes with as few code duplication as possible.
To have the correct types for
image
, we must override it depending on the type of the class (i.e.type
orinput
).Thus I would recommend not adding such exception or allow disabling it. (Another option might be a disallowable option.)
I hope I didn't oversee anything why above example is a bad idea.
Beta Was this translation helpful? Give feedback.
All reactions