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 pybind11::make_key_iterator for map iteration #282

Merged
merged 1 commit into from
Aug 12, 2016

Commits on Aug 12, 2016

  1. Added pybind11::make_key_iterator for map iteration

    This allows exposing a dict-like interface to python code, allowing
    iteration over keys via:
    
        for k in custommapping:
            ...
    
    while still allowing iteration over pairs, so that you can also
    implement 'dict.items()' functionality which returns a pair iterator,
    allowing:
    
        for k, v in custommapping.items():
            ...
    
    example-sequences-and-iterators is updated with a custom class providing
    both types of iteration.
    jagerman committed Aug 12, 2016
    Configuration menu
    Copy the full SHA
    5aa85be View commit details
    Browse the repository at this point in the history