Replies: 2 comments 1 reply
-
It's for sure an interesting concept. I've been doing this for too long that I consider the logic you present pretty understandable, even your But I wonder if tl;dr: I like it, but simplicity is more important than efficiency if that makes sense. |
Beta Was this translation helpful? Give feedback.
-
I don't think introducing a library that imports new coding paradigms is a good idea. Python as a language already comes with the well known Zen "There should be one-- and preferably only one --obvious way to do it.". Maybe it'd worth considering something like this if it was a start or early stage of a project, but given that the codebase isn't small and already quite a while around it would be quite a drastic change and add another layer of complexity to it. Don't get me wrong I really like the concept of returned error codes over exceptions and it does make tge code sacer and predictable |
Beta Was this translation helpful? Give feedback.
-
I recently came across this library which enables Rust like semantics for optional and result types.
This might be very useful for the project. Take the example of the optional object
something
, it can either have some object value orNone
. We have a lot of the code that looks like the following:which could be simplified to the following using this library:
Beta Was this translation helpful? Give feedback.
All reactions