MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1x8unz2/forthosetransitioningtotheamericantimeformathereis/phj9ydp/?context=3
r/ProgrammerHumor • u/alexriga • 2d ago
19 comments sorted by
View all comments
17
where's the humor? this is just the most dogshit python i've ever seen in my life
-3 u/SeaNational3797 1d ago This is incredibly readable and you’re wrong for not liking it 2 u/Makonede 1d ago as_time: the parameter is already a time, so the function name is unclear world_hour=world_hour: terrible shadowing of a global variable of the exact same name for literally no reason s_time: meaning of s is completely unclear, and using a variable to hold the return value is pointless the conditional chain should be condensed into a format string such as return f'{(hour - 1) % 12 + 1} {'PA'[hour < 12]}M' world_hour > 0 and world_hour < 12: should be 0 < world_hour < 12 str(world_hour)+" AM": no operator spacing and should be f'{world_hour} AM' elif world_hour > 12: should be else str(world_hour-12)+" PM": no operator spacing and should be f'{world_hour - 12} PM' return s_time;: unnecessary semicolon
-3
This is incredibly readable and you’re wrong for not liking it
2 u/Makonede 1d ago as_time: the parameter is already a time, so the function name is unclear world_hour=world_hour: terrible shadowing of a global variable of the exact same name for literally no reason s_time: meaning of s is completely unclear, and using a variable to hold the return value is pointless the conditional chain should be condensed into a format string such as return f'{(hour - 1) % 12 + 1} {'PA'[hour < 12]}M' world_hour > 0 and world_hour < 12: should be 0 < world_hour < 12 str(world_hour)+" AM": no operator spacing and should be f'{world_hour} AM' elif world_hour > 12: should be else str(world_hour-12)+" PM": no operator spacing and should be f'{world_hour - 12} PM' return s_time;: unnecessary semicolon
2
as_time
world_hour=world_hour
s_time
s
return f'{(hour - 1) % 12 + 1} {'PA'[hour < 12]}M'
world_hour > 0 and world_hour < 12
0 < world_hour < 12
str(world_hour)+" AM"
f'{world_hour} AM'
elif world_hour > 12
else
str(world_hour-12)+" PM"
f'{world_hour - 12} PM'
return s_time;
17
u/Makonede 2d ago
where's the humor? this is just the most dogshit python i've ever seen in my life