Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Previous dev. of my current work made these entertaining stuff, it was fun and all till i started fixing his legacy spaghetti code.
If i find that fucker i'm gonna back-flip kick him in the face. -
Reading this code has expanded my knowledge of Python capabilities.
Did not know one could do
#this:
for a, b, c in x:
#or this:
return a for a in x
#or even:
return a for a in x for b in y
very interesting indeed.
Thanks, OP! -
@kpenc yeah I thought that was strange too. I've seen class vars start with underscore in Python to make them private, but I didn't think it was standard to end any identifier with.
-
wolfram35058y@corscheid private and protected(so called) members have underscores in the beginning, and some people use the convention of using underscore at the end when they change a variable in a class (if anyone of you have used Sci kit may know )
-
wolfram35058y@corscheid dude I'm also learning - see I'm at the pub and still devRant'ing! Don't judge the poor picture 😁
-
Unless the second one has a better time complexity, yours is better due to readability xd
Trying to keep my code reviewers entertained:
undefined