Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In my own python toolbox (specifically for the list-of-dictionaries use-case) I inject .log(). calls into the pipeline as need to show what the actual intermediate values would be.

Naming intermediates is fine (and encouraged) if there are actually meaningful names to be given. But sometimes the expression itself is the shortest meaningful name for the expression.

Re backslashes, you can also just wrap the expression in parentheses.



A perhaps more appropriate name for your 'log' would be 'peek'. Log reminds of logging, which usually does not return a value, but writes to stdout or a file or similar.


but that's exactly what log does, it is a pipeline filter that logs the content to standard output but otherwise it is passthrough.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: