rsokl/Learning_Python

Can enhance the Example or Change the example to avoid potential Syntax Warning.

ravichandraveeramachaneni opened this issue · 7 comments

In one of the example where is is used instead of == we are getting a potential Syntax Warning. This might be confusing sometimes. So we can enhance the example of why it happens or we can simply change that to use == instead.

Exact location : Generator & Comprehensions Section -> Reading Comprehension Exercise Solution -> Translating a For-Loop (Below screenshot from website):

Screen Shot 2020-08-12 at 3 44 42 PM

So the above code mentioned produces below Warning (screenshot from my system):

Screen Shot 2020-08-12 at 3 46 49 PM

Instead we can use == instead of is operator to have more cleaner interpretation (screenshot from my system):

Screen Shot 2020-08-12 at 3 47 06 PM

Please let me know if this makes sense and also if there is an opportunity I would like to submit a PR for this and in future few more additions.

Thanks in Advance.

rsokl commented

Thanks for pointing this out! I would be happy to have this PR :)

rsokl commented

Oh, and I should be more specific - the example should be using == instead of is

rsokl commented

Hi @ravichandraveeramachaneni - I need to update those guidelines. The preferred method is for you to fork the repo and make a PR from your fork.

I apologize for the confusion / inconvenience

rsokl commented

Thanks for the PR @ravichandraveeramachaneni

I don't have formal guidelines - if you make several contributions to PLYMI, I would happily add you as a contributor :)

rsokl commented

closed by #160