KartikTalwar / Duolingo

Unofficial Duolingo API Written in Python
MIT License
826 stars 128 forks source link

Use properties instead of getters #13

Closed tschuy closed 9 years ago

tschuy commented 9 years ago

With a getter:

lingo.get_certificates()

With a property

lingo.certificates

They're more pythonic, easier to read, etc etc.

We already have lots and lots of get_ methods that all operate just fine. The way this is currently implemented each getter is just called behind the scenes. If someone wants to set a keyword argument, like language, they can just call the old getter just fine.

The reason I'm not using a custom getattr is that not all get_* functions take no inputs.

What do you think?

(This is branched off of #12.)