Skip to content

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