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

Remove DuplicatePropertyError #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Remove DuplicatePropertyError #153

wants to merge 1 commit into from

Conversation

198d
Copy link

@198d 198d commented Feb 14, 2013

It is sometimes desirable to redefine a property in a subclass (e.g. to
override a default value set in parent class). This removes checks for
duplicate properties when using a base class derived from
schema.DocumentSchema.

We talked in #couchdbkit about overriding a default value for a property in a subclass. I had thought I might just be able to redefine the property in the subclass but ran into DuplicatePropertyError and as mentioned, here's a pull request.

Now, this goes to the extreme of just stripping that guard completely. As I was writing it, I thought, it might be worthwhile to, at the very least, make sure the property in the subclass was of the same type, but maybe not. I'd be interested in your thoughts on that.

It is sometimes desirable to redefine a property in a subclass (e.g. to
override a default value set in parent class). This removes checks for
duplicate properties when using a base class derived from
schema.DocumentSchema.
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.

1 participant