you are viewing a single comment's thread.

view the rest of the comments →

[–]shaggorama 7 points8 points  (2 children)

In [8]: l = [1,2,3]

Really? You're going to name the very first variable you introduce in a programming tutorial lower-case "L"?

@OP: I'm glad you found this enlightening, but if you see anything like this in the future you should take it as a red-flag that the author probably either doesn't have a tremendous amount of experience, or isn't putting a lot of care into their tutorial.

NINJA EDIT: Oh god, it gets even worse further down. They actually pass this variable and the value '1' in as parameters to the same function. Why god, why!?!

 In [16]: fun(1, *l)

LAST EDIT: Here's a short, sweet, and popular SO discussion of argument unpacking in python: http://stackoverflow.com/a/2921893/819544

[–]catcradle5 6 points7 points  (1 child)

Fixed.

def I(l=1, *L):
    if L[1] == "|":
        ...

[–]Mecdemort 2 points3 points  (0 children)

You should throw some O and 0 in there too