Hacker News new | ask | show | jobs
by chriszhang 1965 days ago
> How about file-like objects in python? Many file-like interfaces are necessarily stateful.

Still the state and the functions that operate on them can be separated out. Right? No reason why the state and the functions need to be tied together inside a class.

1 comments

Are you suggesting everything that currently takes a file-loke object "f" instead takes "fstate" "fread" "fwrite" "fclose" "fflush"...?