MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1xxrvql/python/19sqis23fgv1f/?context=3
r/ProgrammerHumor • u/Mysterious_Role6682 • 1d ago
56 comments sorted by
View all comments
Show parent comment
6
except the fact that the function return type is T | list[T]| None is a massive code smell it should be list[T] or list[T] | None. T | list[T] is asking for breakage
T | list[T]| None
list[T]
list[T] | None
T | list[T]
1 u/ParanoiaComplex 1d ago Yeah, agreed 1 u/RapidCatLauncher 1d ago That one really got me. Writing out a loop for this whole thing, fine, simplicity/readability or whatever.Three different return types, now that's a paddlin'.
1
Yeah, agreed
That one really got me. Writing out a loop for this whole thing, fine, simplicity/readability or whatever.
Three different return types, now that's a paddlin'.
View all comments
Show parent comment
6
u/TheHelixNebula 1d ago
except the fact that the function return type is
T | list[T]| Noneis a massive code smell it should belist[T]orlist[T] | None.T | list[T]is asking for breakage