News for hackers. Stuff that matters.
Re:PEP 505: Bringing None-Aware Operators to Python by hnra on Sunday August 12, 2018 @08:39AM (#17744092)
Re:PEP 505: Bringing None-Aware Operators to Python by gaius on Sunday August 12, 2018 @08:55AM (#17744143)
operators from C#

Why not go the whole hog then, and do a Option[1] ;-)

[1] https://en.wikipedia.org/wiki/Option_type#F#

Re:PEP 505: Bringing None-Aware Operators to Python by marcosdumay on Sunday August 12, 2018 @10:50AM (#17744580)
What does you gain from optionals if you can't determine types at compile time?
Re:PEP 505: Bringing None-Aware Operators to Python by dragonwriter on Sunday August 12, 2018 @10:54AM (#17744598)
> What does you gain from optionals if you can't determine types at compile time?

As well as type checking (which is relevant because Python has AOT checkers even if they are optional), Options, compared to bills, give you nestability, which is a runtime advantage not dependent on static type checking.

Re:PEP 505: Bringing None-Aware Operators to Python by mmirate on Sunday August 12, 2018 @09:04AM (#17744177)
Option is bubkes if the language itself still has the billion-dollar mistake; that's why F# and Scala are far less practical than OCaml. Python also has it with "None" (though since it is dynamically typed, it's arguable that from the perspective of any given type, every value of every other type is a fresh instance of the billion-dollar mistake).

And sadly, removing None from Python and replacing it by Option - let alone removing Exception and letting Result (aka Either) take its rightful place - would cause huge amount of Python code to need rewriting. And it wouldn't even be worth it because of dynamic typing.