Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.

Fix the encoding/decoding of Enum types.#126

Closed
tbeadle wants to merge 1 commit into
core-api:masterfrom
tbeadle:enum
Closed

Fix the encoding/decoding of Enum types.#126
tbeadle wants to merge 1 commit into
core-api:masterfrom
tbeadle:enum

Conversation

@tbeadle
Copy link
Copy Markdown
Contributor

@tbeadle tbeadle commented Apr 5, 2017

The 'enum' argument is a required parameter to creating an Enum. Store
it in an 'extra' dict that can be passed as **kwargs during its creation.

The 'enum' argument is a required parameter to creating an Enum.  Store
it in an 'extra' dict that can be passed as **kwargs during its creation.
'description': schema.description
}
if isinstance(schema, coreschema.Enum):
retval['extra'] = {'enum': schema.enum}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could just put this value directly under enum rather than having an extra dictionary.

Thanks for progressing this!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured that using 'extra' would allow it to be used for other types in the future.

@dkvdm dkvdm mentioned this pull request May 3, 2017
@dkvdm
Copy link
Copy Markdown

dkvdm commented May 3, 2017

Any news on this PR? @tomchristie, do you agree with @tbeadle's comment on the usage of the extra dictionary?

@lovelydinosaur
Copy link
Copy Markdown
Contributor

Closed via #135 (pycon sprints)

Thanks so much for kicking this off!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants