Obviously you don't realise that your my_user_input as well as your partial derivatives are non-sense.
so there is no need for partial function for str.
Next when you pass int to argument type (by the way terrible name because it overwrite built-in
if you want to test for type check isinstance()
Finally using partial for this is bit unusual so to say
input
will always return type str
.so there is no need for partial function for str.
Next when you pass int to argument type (by the way terrible name because it overwrite built-in
type
function in the body of your function) you compare what user has entered, e.g. '1'
to int('1')
, i.e. '1' == 1
, which is ALWAYS False. Only because it does not rise ValueError, it looks like it works (i.e. you think it check type, but it actually compare what was entered with it converted to int).if you want to test for type check isinstance()
Finally using partial for this is bit unusual so to say