braintree / braintree_python

Braintree Python library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
242 stars 115 forks source link

Support iterator protocol in ResourceCollections #60

Closed iartarisi closed 8 years ago

iartarisi commented 8 years ago

Make the ResourceCollection class implement the iterator protocol. This is the idiomatic way to iterate in python and doesn't create any suprises.

The ResourceCollection.items() method is unchanged (for backwards compatibility). So __iter__ simply calls that for now.

kexline4710 commented 8 years ago

@mapleoin We think this pull is a great addition to the library and contains sufficient testing. I'm merging this and including it in the next release.