@[email protected] to Programmer [email protected] • 1 year agoReturns a sorted list in O(1) timeprogramming.devimagemessage-square27fedilinkarrow-up1279arrow-down115
arrow-up1264arrow-down1imageReturns a sorted list in O(1) timeprogramming.dev@[email protected] to Programmer [email protected] • 1 year agomessage-square27fedilink
minus-squareTrailblazing Braille Taserlinkfedilink10•1 year agoBesides the obvious flaws… is that parameter a list named list, shadowing the list() constructor?
minus-square@infinitepcglink5•1 year agoIt works as long as you don’t call list() within that function.
minus-squareTrailblazing Braille Taserlinkfedilink3•1 year 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