Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what would break if ...
#1
what would break if the code syntax was extended so that {{ and }} bounds a frozenset like { and } bounds a set?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
I think it would break the idea that the syntax must not be altered for a marginal use case. I'm 99% certain it would be rejected for this reason.
Reply
#3
(Apr-22-2022, 10:44 PM)Gribouillis Wrote: I think it would break the idea that the syntax must not be altered for a marginal use case. I'm 99% certain it would be rejected for this reason.

i would have to agree with that. but, is there anything in the syntax of the language that would break? i am asking this way for my thinking about the design of a new special-purpose language, not really a change to Python (but one hat borrows much from it).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
Currently, nothing breaks because {{...}} raises a TypeError because sets and dicts are non-hashable. Note that this is not a SyntaxError. If sets become hashable someday, it will collide with your proposed syntax.
Reply
#5
(Apr-26-2022, 09:04 PM)Gribouillis Wrote: If sets become hashable someday, it will collide with your proposed syntax.
if that were to happen, then what would be the point of having a frozenset? a mutable object being hashable i cannot imagine unless its hash is allowed to vary. that could be very interesting. if i were to fork Python (to add my own syntax), it would have to be a fork of a specific version, i would think.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020