Skip to content

Generator with Slice assignment trick - #61

Merged
satwikkansal merged 4 commits into
satwikkansal:masterfrom
sohaibfarooqi:master
Feb 25, 2018
Merged

Generator with Slice assignment trick#61
satwikkansal merged 4 commits into
satwikkansal:masterfrom
sohaibfarooqi:master

Conversation

@sohaibfarooqi

Copy link
Copy Markdown
Contributor

Hi,
I though of contributing to your great collection of python tricks. The example I included is iterating a generator expression after updating the iterable of generator. The trick here is updating the iterable using normal assignment vs slice assignment, which will produce different results.

Also please suggest a cool title if you can :)

Thanks
Sohaib

@satwikkansal

satwikkansal commented Jan 29, 2018

Copy link
Copy Markdown
Owner

Hey @sohaibfarooqi

I appreciate you taking out time to contribute to the collection. However, after reviewing your PR, I found a few mistakes (syntactic and grammatical). Do you mind creating an issue for this example first?, I guess it's more convenient to discuss it out first 馃槄 . There's a similar example already in the collection and I guess we can merge these two somehow.

@sohaibfarooqi

sohaibfarooqi commented Jan 29, 2018

Copy link
Copy Markdown
Contributor Author

Hi,
Yes there is a similar example, However its not exactly equal to the one I submitted in this PR. Thats why I placed it just below that one, because they both revolve around generator expressions.

I noticed that example I wrote do have some syntactical issues. I will modify it to make it a working example. After that I will open an issue so that we can discuss.

Thanks,
Sohaib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants