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

Document base class should allow all property names with best effort #21

Open
sseg opened this issue Mar 18, 2016 · 1 comment
Open

Comments

@sseg
Copy link

sseg commented Mar 18, 2016

Although the name argument for fields allows any name to be assigned to a property, the Document class should at least try to avoid polluting the namespace of schemas.

Unknowingly overwriting a class attribute can sometimes produce confusing errors.
TypeError: 'StringField' object is not callable is thrown from the class definition:

class Schema(Document):
    walk = StringField()

Internal methods of Document and it's parents could be prefixed with an underscore to at least try to preserve more of the namespace for users and reduce the cases where an alias must be invoked.

@aromanovich
Copy link
Owner

Unfortunately, Document's methods are public and documented and can not be renamed without breaking backwards compatibility. I'll consider renaming them in the next major version.

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

No branches or pull requests

2 participants