|
|
|
|
|
by MichaelGG
5702 days ago
|
|
I'm not familiar with python - does it have some magic global sentinel value to indicate "not found"? Or how do you handle that case with that 1 line of code? Secondly, saying "it's still .NET" is similar to saying "it's still x64". The F# compiler does a lot of transforms on code that the C# compiler does not. In some cases, this can result in better IL and better JIT'd code. Also, having inlining support at the compiler level can be very handy sometimes. |
|
No, it has a different method for failable search. The purpose of `get` is specifically to handle "provide a default value in case the key is not found".
> Or how do you handle that case with that 1 line of code?
dict[key]