Is there a way with #Python types to accept an Iterable, but only ones that won't be consumed by iteration? So set, list, dict are fine, but generators and files are not? I suspect not.
Is there a way with #Python types to accept an Iterable, but only ones that won't be consumed by iteration? So set, list, dict are fine, but generators and files are not? I suspect not.
If you have a fediverse account, you can quote this note from your own instance. Search https://hachyderm.io/users/nedbat/statuses/116029317190552492 on your instance and quote it. (Note that quoting is not supported in Mastodon.)