News for hackers. Stuff that matters.
Re:Anti-Patterns in Python Programming by tribaal on Wednesday July 09, 2014 @10:55AM (#8009914)
Well, that's throwing people implementing subclasses under the bus, IMO.

Why not just add @param annotations in your docstrings instead?

Re:Anti-Patterns in Python Programming by geertj on Wednesday July 09, 2014 @11:32AM (#8010171)
> Well, that's throwing people implementing subclasses under the bus, IMO.

If they need to touch this argument in an overridden method and they don't know what they are doing, then yes.

> Why not just add @param annotations in your docstrings instead?

I'm using Sphinx and it renders them separately. I want the empty dict to show up in the function signature.

Re:Anti-Patterns in Python Programming by Peaker on Wednesday July 09, 2014 @03:02PM (#8011574)
A single cryptic bug due to this practice will more than negate the minor doc readability benefits you get from that. And there will likely be many more than one cryptic bug.

There are other ways to emphasize it ought to be a dict/mappable. Change its name to be suffixed as "_dict", for example?