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

Implement get() for CLAMData? #50

Closed
mhkuu opened this issue Apr 25, 2017 · 2 comments
Closed

Implement get() for CLAMData? #50

mhkuu opened this issue Apr 25, 2017 · 2 comments

Comments

@mhkuu
Copy link

mhkuu commented Apr 25, 2017

Maybe this is already possible, but it would be nice to be able to use Python's dictionary method get() (with a default if the key is not found) for CLAMData, so that you can put e.g.

clamdata.get('test', 1.23)

instead of

test = 1.23
if 'test' in clamdata:
     test = clamdata['test']

or something equivalent. Maybe by subclassing Mapping?

@proycon
Copy link
Owner

proycon commented Apr 25, 2017

Sounds like a good idea yeah!

@mhkuu
Copy link
Author

mhkuu commented Apr 26, 2017

OK, I'll create a pull request soon!

@proycon proycon added this to the v2.4.0 milestone Nov 19, 2018
@proycon proycon self-assigned this Nov 19, 2018
@proycon proycon added the ready label Nov 19, 2018
@proycon proycon closed this as completed Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants