From aikimark at aol.com Mon Dec 28 11:12:01 2020 From: aikimark at aol.com (Mark Hutchinson) Date: Mon, 28 Dec 2020 16:12:01 +0000 (UTC) Subject: [TriPython] mnemonic? References: <758967783.4966972.1609171921529.ref@mail.yahoo.com> Message-ID: <758967783.4966972.1609171921529@mail.yahoo.com> Does anyone know a good mnemonic to help remember/teach about iterables and iterators/generators? I was thinking about using something like"Jenny, I got your number, but what is your intent?" But that really doesn't cover it. Question Context:James Powell gave 26 lightning talks during the end-of-year numFOCUS telethon.? Each topic was a letter of the alphabet.? Since the moderator gave James the actual topic, this was pretty impressive.? His last talk was the Zip function.? He created/shared a way to easily window your iterable data.https://youtu.be/gzbmLeaM8gs?t=15661 I wrote James and said "thanks."? I also suggested what I thought might be a simpler version of his nwise function, not using the tee() function.?? nwise2 = lambda g, n=2: zip(*(islice(g, idx, None)?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? for idx in range(n))) James's response was that he wrote for the general case and that it covers iterables that are not iterators, such as generators. `nwise` is a general solution to finding overlapping windows from any iterable. If provided an iterator (e.g., a generator instance) then the use of `itertools.tee` is mandatory, irrespective of whether the underlying iterable is concrete or has memory.? `nwise` is intended to work with non-concrete or memory-less or otherwise non-rewindable iterables (e.g., generators,) but this is not the narrowest requirement leading to `itertools.tee`. Since `range(10)` is an iterable (but, by itself, not an iterator,) then each `islice` will create its own `range_iterator`, in which case you would not need to `tee` Palm to forehead moment.? Of course my simpler function worked, but I haven't learned to see iterables the way I need to see them.? I don't differentiate them.? I'm hoping to find a mnemonic to help compensate for that. Happy Holidays Stay safe Mark Hutchinson -------------- next part -------------- Does anyone know a good mnemonic to help remember/teach about iterables and iterators/generators? I was thinking about using something like "Jenny, I got your number, but what is your intent?" But that really doesn't cover it. Question Context: James Powell gave 26 lightning talks during the end-of-year numFOCUS telethon.? Each topic was a letter of the alphabet.? Since the moderator gave James the actual topic, this was pretty impressive.? His last talk was the Zip function.? He created/shared a way to easily window your iterable data. https://youtu.be/gzbmLeaM8gs?t=15661 I wrote James and said "thanks."? I also suggested what I thought might be a simpler version of his nwise function, not using the tee() function.?? nwise2 = lambda g, n=2: zip(*(islice(g, idx, None)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? for idx in range(n))) James's response was that he wrote for the general case and that it covers iterables that are not iterators, such as generators. `nwise` is a general solution to finding overlapping windows from any iterable. If provided an iterator (e.g., a generator instance) then the use of `itertools.tee` is mandatory, irrespective of whether the underlying iterable is concrete or has memory.? `nwise` is intended to work with non-concrete or memory-less or otherwise non-rewindable iterables (e.g., generators,) but this is not the narrowest requirement leading to `itertools.tee`. Since `range(10)` is an iterable (but, by itself, not an iterator,) then each `islice` will create its own `range_iterator`, in which case you would not need to `tee` Palm to forehead moment.? Of course my simpler function worked, but I haven't learned to see iterables the way I need to see them.? I don't differentiate them.? I'm hoping to find a mnemonic to help compensate for that. Happy Holidays Stay safe Mark Hutchinson From lumetta at gmail.com Mon Dec 14 15:49:55 2020 From: lumetta at gmail.com (Jake Lumetta) Date: Mon, 14 Dec 2020 20:49:55 -0000 Subject: [TriPython] [Job] Director of Engineering for Headless CMS SaaS Startup Message-ID: Howdy TriPython, I'm Jake, founder and CEO of ButterCMS. I'm looking for someone to own tech at ButterCMS. We're built on Django + Vue.js. You'd work closely with me (founder) on all product initiatives. There?s zero bureaucracy - you will have maximum autonomy and responsibility. Butter is the #1 rated headless CMS. Developers love us. We exist to make their lives better. As a Director of Engineering you?ll own all technology, be responsible for the entire ButterCMS platform, and most importantly, ensure that our customers are successful. Learn more: https://djangogigs.com/gigs/director-of-engineering-for-headless-cms-saas-startup-buttercms-lqyma8/ Cheers, Jake -------------- next part -------------- Howdy TriPython, I'm Jake, founder and CEO of ButterCMS. I'm looking for someone to own tech at ButterCMS. We're built on Django + Vue.js. You'd work closely with me (founder) on all product initiatives. There?s zero bureaucracy - you will have maximum autonomy and responsibility. Butter is the #1 rated headless CMS. Developers love us. We exist to make their lives better. As a Director of Engineering you?ll own all technology, be responsible for the entire ButterCMS platform, and most importantly, ensure that our customers are successful. Learn more: ?[1]https://djangogigs.com/gigs/director-of-engineering-for-headless-cms-saas-startup-buttercms-lqyma8/ Cheers, Jake References Visible links 1. https://djangogigs.com/gigs/director-of-engineering-for-headless-cms-saas-startup-buttercms-lqyma8/