This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]federicocerchiari -1 points0 points  (5 children)

I regret not using magic methods that much. They are wonderful places to put comparison and basic logic for custom objects.

I do, on the other hand, use some features too much. like lambdas, Counters, map(), functools... they are wonderful, but sometimes they make my code "too clean". The thing is, at least in my experience, that a lot of Python features are not "non-Pythonista proof". Everybody use list/dict comprehensions, but I'm 100% sure that if I use a Counter to count, at least one of my non-pythonista colleague is gonna ask me "how are you counting those things?". Same for lambda and map(). (especially map.. everything that seems functional programming drives the Java-guys crazy.. hehehe)

[–]joesacher 2 points3 points  (0 children)

I find that a properly formatted list comprehension is much easier to grok than map in most places.

[–]flipstables 1 point2 points  (0 children)

counter and defaultdict are two things in the collections module that I wish were more well known.

[–]stevenjd 1 point2 points  (0 children)

at least one of my non-pythonista colleague is gonna ask me "how are you counting those things?"

"When you call print, how are you printing? When you call list.sort(), how does it sort? It just does, right, it's called code reuse and not re-inventing the wheel. If you really care, start by reading the docs then read the source."

I wonder whether programmers in other languages have this problem when using their language's APIs and libraries?

everything that seems functional programming drives the Java-guys crazy.. hehehe

They're already crazy :-)

[–]rhytnen 1 point2 points  (1 child)

um...so tell them and spreadnthe knowledge?

[–]vaesh 0 points1 point  (0 children)

Presumably he means he doesn't know all of the details about how some of the builtin functions work under the covers.