Maybe the "special optimizable method" will solve some of the problems, and
appraise the "no new syntax" folks. But IMHO, it (1) it is more verbose
than the prefix/suffix new syntax alternatives, to the point of getting
in the way of reading

mysets = [{1 ,2 ,3 }.freeze(), {4,5,6}.freeze()]
X
mysets = [{f{1, 2, 3}, f{4, 5, 6}]

and (2), as stated, although introducing no new syntax, require
fiddling in a couple of places in order to actually work in an optimized
way,
and the optimization would end up as an "implementation detail".

(In order not to generate yet another message): I've seem no new arguments
by the opponents of "f{...}"at all - but re-stating that "strings are
different than sets".
Indeed: strings(bytestrings, raw, fstrings) have a lot of factors in common
that the
other built-in datatypes don't share. But the prefix thing is orthogonal to
that,
and the same motivations that led to the introduction of quote-prefixes for
strings
to start with apply here, with no drawbacks. As already stated
in other messages, calling it a "bug magnet" is a gross exaggeration. One
would
get a "NameError" on the first try and have it either fixed seconds later,
or revisiting the concept of functions and calling functions, which would
be needed anyway, in case the person in error is a begginner
to programming in general.

best regards,

   js
  -><-


On Wed, Jan 19, 2022 at 10:14 AM Steven D'Aprano <st...@pearwood.info>
wrote:

> On Wed, Jan 19, 2022 at 01:56:54PM +0100, Marco Sulla wrote:
>
> > PEP 351 for the frozen protocol was rejected. I didn't read why, but
> > it's probably hard to resurrect.
>
> This is not a proposal for a generic frozen protocol. It is a simple
> proposal for a set method that returns a frozenset, with the aim that
> the peephole optimiser will be able to optimise the call out for set
> displays consisting only of literals.
>
>
> --
> Steve
> _______________________________________________
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/BH2VZ3RSI3KRQ4F6P6HHZ23APR6CBQ3R/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/PPON7EOH7ZFQDEQNACMLPR3RQS55ZUKQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to