python-api-client icon indicating copy to clipboard operation
python-api-client copied to clipboard

add iter in FeedlyData

Open lhoestq opened this issue 6 years ago • 4 comments

should fix #12

lhoestq avatar Jun 28 '19 22:06 lhoestq

if 'content' in entry: entry, instance of FeedlyData, is not supposed to be an iterable right ? Rather, we should use the contains method that checks for membership in the _json ?

Edouard360 avatar Jun 30 '19 15:06 Edouard360

Well if we only have the contains overloading, then something like for i in entry would do a infinite loop. That's why iter overloading was ok because it also fixes this case

lhoestq avatar Jun 30 '19 15:06 lhoestq

We're not supposed to do iter this way in the first place, are we ? Wouldn't we rather raise an error if we wanted to take that edge case into account ? Maybe we could put an unit test for your case for i in entry ...

Edouard360 avatar Jun 30 '19 15:06 Edouard360

We're not supposed to do iter this way in the first place, are we ? Wouldn't we rather raise an error if we wanted to take that edge case into account ? Maybe we could put an unit test for your case for i in entry ...

i think this would be a good solution...if people really want some dictionary like behavior on the data, they can call .json and use the underlying data?

kireet avatar Jul 01 '19 17:07 kireet