On Sat, 22 Jan 2022 at 00:56, Joao S. O. Bueno <jsbu...@python.org.br> wrote:
>>
>> I don't understand polynomials as frozensets. What's the point of
>> representing them that way? Particularly if you're converting to and
>> from dicts all the time, why not represent them as dicts? Or as some
>> custom mapping type, if you need it to be hashable?
>
>
> Sorry for deviating here, but this kind of argumentation is one
> that is sensitive for me -   but here it is:
> I personally do not think the  comment above adds anything to the discussion 
> at hand.
> We've been presented to a real-world use case of frozensets that would
> benefit in readability from having a dedicated literal. How good it is to
> question the way it is coded without even checking the project out?
> (and even so, do that publicly in a non related discussion?)
>
> I had this happen to me in an email here, when I tried an early
> version of match/case in a code in a project of mine. Despite
> being a more or less internal API, the code was bashed in
> a way, in an unasked for code review,
>  it took out the fun I had in coding the project for months.
>
> So, please, take care when deviating from the discussion at hand.

My comment was part of a lengthy response to a post which itself added
little, because it *would not benefit from literals*. My post was
arguing that this was the case. It was, in fact, entirely part of this
discussion. I did take care, and I was making points that are fully
relevant to whether a literal syntax would be beneficial or not.

> Back on topic:
> It looks like this thing of "prefixes are valid for strigns and no good
> for anything else" is, as yoiu put it, Chris, a personal thing.

Every opinion expressed in this thread is a personal one. You can't
dismiss one of them that way without dismissing them all. Does the
viewpoint have merit? It either does, or does not, regardless of who
came up with it. Please take care when deviating from discussion of
actual arguments to discussion of people.

> Do we have anyone else in this thread commenting (or even
> "+1ing") on that side? As I've mentioned a couple
> of times before: is there any other arguments against
> "f{}" other than "prefixes should be for strings only"
> (and the"bug magnet" perceived by many as a plain
>  incorrect statement )?

We don't have anyone justifying it or disproving it. Only people
saying whether they like it or not. Ultimately, it is a matter of
aesthetics - whether the syntax is ugly or elegant. My opinion is that
it is ugly. Your opinion, it seems, is that it is elegant. These are
two equally valid opinions.

> If there is not, then we are not at "there is no viable syntax",
> as prefixable braces are perfectly viable. It is whether it should be
> done or not, despite some people finding it ugly, which is subjective.

On the contrary; if it is ugly, it probably shouldn't be done, so the
two questions are actually the same question.

Unless by "viable syntax" you are distinguishing from syntaxes which
can be rejected swiftly as being ambiguous or already legal with other
semantics (for instance, ({1,2,3}) should be rejected as unviable),
but few of the proposed syntaxes fall foul of that.

> At that point, I argue that despite adding still more things to
> the syntax, it is one that will spare time in average than the other
> way around, due to the time people, needing frozensets for
> the first time in any project, waste looking for a literal syntax for them
> only to find out there is not any.
>

Have you any stats on this? There is no literal/display syntax for
datetimes, regular expressions, ranges, bytearrays, or a host of other
common types. How often do people reach for a literal syntax for
those? (I say "literal/display" since, technically, dicts have a
display syntax, not a literal, and complex numbers are written as a
constant-folded sum, but in practical terms, those count. The other
types don't even get that.) If frozensets are so special that they
need syntax, why not ranges, which are used far more frequently?

With the method idea, there's a fully backward compatible way to add
it to the language, and an optimization that can be applied to many
types.

So I'm -1 on dedicated syntax for frozensets, -1 on prefixes on
braces, and +0.5 on set.frozen() and the ability to constant-fold
that.

But that's just personal opinion. Like everything else in this thread.

ChrisA
_______________________________________________
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/IE2KJ2UU64SKJPQBETEKOJ2V2TBNTNMU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to