|
|
|
|
|
by odonnellryan
4480 days ago
|
|
Unpacking pretty much does one thing, and it makes that one thing easier and a lot more readable. Combine that with list comprehension (from what I understand C#'s LINQ is similar) and you end up with code that's highly maintainable/readable (as long as you name your variables appropriately, of course). I believe Python supports pattern matching other than Regex as well. |
|
> I believe Python supports pattern matching other than Regex as well.
That's pattern matching on strings. The kind of pattern matching being discussed here is pattern matching on data types (see [1]).
1: http://en.wikipedia.org/wiki/Pattern_matching