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

add a __contains__ to Records #11

Closed
nhumrich opened this issue Jul 26, 2016 · 3 comments
Closed

add a __contains__ to Records #11

nhumrich opened this issue Jul 26, 2016 · 3 comments

Comments

@nhumrich
Copy link

nhumrich commented Jul 26, 2016

Since records work like dictionaries (record['my_column']), it would be awesome if the in operator worked. Would it be possible to add a __contains__ method to a record?

I was going to submit a PR with this, but for the life of me I cant find the record object, I think it might be implemented in C

@1st1
Copy link
Member

1st1 commented Jul 26, 2016

Good idea! I'll do it.

I was going to submit a PR with this, but for the life of me I cant find the record object, I think it might be implemented in C

Yes, it's implemented in pure C in asyncpg/protocol/record/recordobj.c.

@1st1
Copy link
Member

1st1 commented Jul 26, 2016

Added in v0.5.2. Please check it out!

@1st1
Copy link
Member

1st1 commented Jul 29, 2016

Closing this one.

@1st1 1st1 closed this as completed Jul 29, 2016
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