Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Lazy – A Python library for rapidly developing lazy interfaces (github.com/bwasti)
10 points by bwasti on Sept 26, 2018 | hide | past | favorite | 4 comments


Cool. Won't it break if a function is "pure" from the practical point of view but in fact uses some variables (e.g. configuration parameters) declared outside of it?


as long as configuration parameters remain fixed in the life of the execution it is still pure, right?


Yes, that's what I mean but I'm not sure from the theoretical point of view. I used to believe a truly pure function isn't mean to access anything but what is passed to it as an argument so it makes me wonder what a particular implementation may expect. Whether or not this is Ok can also depend on a particular language runtime or library (and I'm far from an expert in the Python VM internals so far) - it can be impossible or quirky for a function executed asynchronously to access something that belongs to outside of it.


ah, the assumption is that even the remote call (for example, in the case of async) is pure




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

Search: