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

Automatically import `fields` module. #557

merged 1 commit into from Dec 1, 2016


Copy link

commented Nov 30, 2016

marshmallow/ should do from . import fields. This would save some lines for the users. Any schema needs fields, there is no reason to not import the module automatically.

This would help in such case:

import marshmallow as mm

class UpgradeNowSchema(mm.Schema):
    plan = mm.fields.String(required=True)

Otherwise I need to:

import marshmallow as mm
import marshmallow.fields

which looks strange and ugly.

I would be even better to have fields in the main namespace:

plan = marshmallow.String(required=True)

then I would avoid shortening marshmallow -> mm or ma.

@sloria sloria merged commit c0afff5 into marshmallow-code:dev Dec 1, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

This comment has been minimized.

Copy link

commented Dec 1, 2016


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.