Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Add thrift_meta etc. #138

Merged
merged 3 commits into from
Jun 15, 2015
Merged

Add thrift_meta etc. #138

merged 3 commits into from
Jun 15, 2015

Conversation

hit9
Copy link
Contributor

@hit9 hit9 commented Jun 14, 2015

if key not in meta:
meta[key] = []

meta[key].append(val)
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use defaultdict here:

if not hasattr(thrift, '__thrift_meta__'):
    setattr(thrift, '__thrift_meta__', collections.defaultdict(list))
thrift.__thrift_meta__.append(val)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@maralla
Copy link
Contributor

maralla commented Jun 15, 2015

👍

@hit9
Copy link
Contributor Author

hit9 commented Jun 15, 2015

@maralla updated @lxyu

maralla added a commit that referenced this pull request Jun 15, 2015
@maralla maralla merged commit f9f0ca4 into Thriftpy:develop Jun 15, 2015
@hit9 hit9 deleted the add-interface-for-services-etc branch June 15, 2015 13:24
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