Enlightenment is realizing that variables don’t have nor need a type, they are all just arrays of bits.
- 0 Posts
- 4 Comments
Joined 2 years ago
Cake day: June 23rd, 2023
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
PowerCrazy@lemmy.mlto Programmer Humor@lemmy.ml•Python needs an actual default functionEnglish1·1 month agoI can import my_script2.py into my_script.py it doesn’t run the main method unless I specifically invoke my_script2.main() though.
PowerCrazy@lemmy.mlto Programmer Humor@lemmy.ml•Python needs an actual default functionEnglish5·1 month agoIdk, I guess I should ask why python needs a default function? If I’m running it as a script with commandline invocation I just copy and paste the if main namespace thing from stack overflow and it works as I intended. It also works if I invoke via python my_script.py $args, so I don’t really see why I should philosophically care about how other languages that I’m not using do it.
How can my JSON response have any concept of Type? If I return a number and you treat it is a string, my API doesn’t have any concept of that. Now in the actual spec of the API I could say that specific URI will return an
int
, but it’s up to your side to classify the array of bits as anint
instead of astr
.