On Sun, Oct 17, 2021 at 4:38 PM Steven D'Aprano wrote:
> Right-o, the old "heterogeneous tuples versus homogeneous lists"
> distinction, I remember that from the old 1.5 days. I haven't heard it
> mentioned for a long time!
>
You must not have looked at type annotations then. :-) Type annotation
We don't have tuple comprehensions, and this proposal isn't to add them,
so this post is edging into off-topic for the thread so feel free to
skip it.
On Sat, Oct 16, 2021 at 03:18:20PM -0400, David Mertz, Ph.D. wrote:
> Rather, I'm concerned with readability and programmer expectations. Tuples
On Sun, Oct 17, 2021 at 02:48:48PM +0100, Rob Cliffe via Python-ideas wrote:
> I'm sending this to python-list because my emails to python-dev keep
> getting bounced back (after a few days delay). I've no idea why.
If you are getting a bounce message, as opposed to the email just
disappearing i
> On Oct 17, 2021, at 3:40 AM, Serhiy Storchaka wrote:
>
> 16.10.21 17:07, Erik Demaine пише:
>> (*it for it in its) # tuple with the concatenation of iterables in 'its'
>
> As others already have said, it should evaluate to a generator, not to a
> tuple.
>
> But other question is occurred n
17.10.21 16:08, Eric V. Smith пише:
> Serhiy: could you explain the difference?
The difference between `for x in it: yield x` and `yield from it` is
than in the latter case any values passed in with send() and any
exceptions passed in with throw() are passed to the underlying iterator
if it has t
I'm sending this to python-list because my emails to python-dev keep
getting bounced back (after a few days delay). I've no idea why.
Instead of `except group ...`, what about `except for ...`?
No new keywords.
Reads naturally in English.
Hints that there is more than one kind of exception com
I guess you could work around this by exploiting the slicing operator:
GenericClass[:(A, B)]
It makes sense to use the : in the context of typing, but I can see how this
syntax can be confusing. The least confusing implementation I could think of is
to limit the use of GenericClass[:_] to tuple
On Sun, Oct 17, 2021 at 8:26 PM Steven D'Aprano wrote:
> (I think the difference has to do with sending values into the
> generator, throwing and catching exceptions, but I can't think of a
> simple example where it would make a difference.)
Yeah mainly. And genexps don't usually do that. So it n
We can already easily simulate your first alternative in a generator
comprehension:
(x for it in its for x in it)
# equivalent to
def gen(its):
for it in its:
for x in it:
yield x
so anyone who wants that behaviour can easily get it. So unpacking
08.10.21 22:23, Jeremiah Paige пише:
Point = namedtuple(<<<, 'x, y, z')
Point
>
>
>
UUIDType = NewType(<<<, str)
UUIDType
> __main__.UUIDType
In many cases similar to namedtuple and NewType this is not enough. You
need to pass to the constructor not only name, but module nam
16.10.21 17:07, Erik Demaine пише:
> (*it for it in its) # tuple with the concatenation of iterables in 'its'
As others already have said, it should evaluate to a generator, not to a
tuple.
But other question is occurred now. Should it be equivalent to
def gen(its):
for it in its:
11 matches
Mail list logo