`frozenset` and `frozendict` comprehensions

I implemented both versions with f and $ as prefixes for { :slight_smile:

Now, we would have to decide which one is better. There are several concerns for each of them:

  • f
  • Looks like fstring: f{0} and f'{0}', but does a completely different thing: Frozen vs Format
  • In fstring you can use both F and f, it would be strange to allow the same for f{. So, it would be incosinstent
  • It is rather hard to read when these things are nested: f{f'{user}', f'{task}'}
  • It does not scale for other possible similar syntax (which is not a part of the proposal, but just a possibiliy for the future). Because f() and f[] are already valid as a syntax

Now, the second option:

  • $
  • It is a new unfamiliar thing, that people might associate with PHP or BASH
  • It one of the last unused symbols in the syntax

Why not some other options?

  • No identifiers apply because of the scalability concerns
  • No suffixes apply, because it is hard to read
  • No chars that are used in operators apply, because they create ambiguity when parsing
  • No existing valid syntax apply, we can’t break stuff. So, things like {{}} won’t work :frowning:

We are left with very little options, which are reasonable. With this in mind: please, vote :slight_smile:

  • ${}
  • f{}
0 voters