@JPDev@programming.dev to Programmer Humor@programming.dev • 10 months agoReturns a sorted list in O(1) timeprogramming.devimagemessage-square25fedilinkarrow-up1251arrow-down112
arrow-up1239arrow-down1imageReturns a sorted list in O(1) timeprogramming.dev@JPDev@programming.dev to Programmer Humor@programming.dev • 10 months agomessage-square25fedilink
minus-squareTrailblazing Braille Taserlinkfedilink11•10 months agoBesides the obvious flaws… is that parameter a list named list, shadowing the list() constructor?
minus-square@infinitepcg@lemmy.worldlinkfedilink5•10 months agoIt works as long as you don’t call list() within that function.
minus-squareTrailblazing Braille Taserlinkfedilink2•10 months agoWell duh. I wonder what happens if you shadow the list constructor and try to use it as a type hint… def foo(list: list): def bar(thingies: list): pass
Besides the obvious flaws… is that parameter a list named
list
, shadowing thelist()
constructor?It works as long as you don’t call
list()
within that function.That is a type hint
Well duh. I wonder what happens if you shadow the list constructor and try to use it as a type hint…
def foo(list: list): def bar(thingies: list): pass