Anonymous
04/25/24(Thu)17:25:19 No.100180065 >>100164005
>Loop variables assign rather than create a new scope
Ok, that's a valid and nice criticism
>Every value can be used in a conditional and random arbitrary values test as false. If you want to be able to use every value then at least make only False and None test as false.
Again it's a valid point and often when I write an if I take a small pause to think how an empty structure well evaluate and if I'm ok with it and then I tweak the type annotations and I'm happy, I kinda like this implicitness but I also get why it may not be good either
>functions that reach the end of their body without returning return None
How's that a problem?
>default values in function arguments are executed at function definition time, not when the function is called
That's an epic gotcha of Python and you are awesome for bringing it up. Personally I always use immutable values as default arguments, e.g foo: list[str] | None = None
. Btw python made the perfect choice on making strings immutable, unlike ruby.
>initialization and assignment of variables shares the same syntax
I don't get this, could you share some pseudocode of how you want it to be?
Great post btw!