MediaMath / t1-python

Python SDK for MediaMath Platform APIs
https://developer.mediamath.com/
Apache License 2.0
18 stars 28 forks source link

Update entity.py #31

Closed wheaties closed 9 years ago

wheaties commented 9 years ago

Couldn't help myself. That _valid_id, no point checking a boolean to then return the value of that boolean. Just return the boolean!

pswaminathan commented 9 years ago

Thanks! I wrote that function ages ago for a perceived use, but I don't think I used it anywhere. Initially I was going to check that the ID was valid before posting, but decided that I'd just trust that no one is going to modify IDs themselves anyway. I think I'd rather just delete the method altogether.

Cawb07 commented 9 years ago

Deleting the function aside, wouldn't you want to return int(id_) >= 1, since previously you would return False if int(id_) < 1?

if condition: return False ---> return not condition lol

pswaminathan commented 9 years ago

You are correct @Cawb07 . But I'm going to remove this function in the next update anyway: I can confirm it's dead code, and I don't want that functionality anyway.

$ ag valid_id
terminalone/entity.py
136:    def _valid_id(id_):
$