One thing which I am missing though is matching on f-strings. Such a powerful feature in Scala.
[1] https://www.python.org/dev/peps/pep-0636/#adding-a-ui-matchi...
[2] https://www.python.org/dev/peps/pep-0636/#going-to-the-cloud...
One thing which I am missing though is matching on f-strings. Such a powerful feature in Scala.
[1] https://www.python.org/dev/peps/pep-0636/#adding-a-ui-matchi...
[2] https://www.python.org/dev/peps/pep-0636/#going-to-the-cloud...
Also you can match a map since every map is just a sequence of Tuples in scala. However why would you ever do this? It is really impractical for large sequences and if I have only a very limited number of attributes I would not use a map I guess.
And have to add an underscore in the right position when you ever add an attribute? With partial matching like described, you don't have to change the pattern when adding fields to the data structure. I guess the GP was referring to this.
Also I get that there are reasons for the Map matching not being present in Scala. All I am saying is that it's cool that it's in python.
case x:YourCaseClass if(x.oneField=="value") => ...