jmcarp / betfair.py

A Python wrapper for the Betfair API
MIT License
103 stars 76 forks source link

Make filter an optional argument where applicable #12

Closed petedmarsh closed 9 years ago

petedmarsh commented 9 years ago

Various API methods require a filter parameter which is expected to be a MarketFilter object. This object must be specified but may be empty (in which case the response is unfiltered). Therefore it's not absolutely required for users to pass a MarketFilter to methods which previously required it.

Where previously you would have to do something like:

event_types = client.list_event_types(
     MarketFilter(text_query='tennis')
)

you can now:

event_types = client.list_event_types()

This does require that the signature of Betfair#list_time_ranges change to allow the filter parameter to be optional, so this is not backwards compatible.

Anyway - a very small change that you may decide isn't worth breaking the existing API for :)