Side Effects

Sources of side-effects in Python

  • external
    • keyboard input (e.g. raw_input, sys.stdin)
    • console output (e.g. print, sys.stdout, sys.stderr)
    • filesystem (e.g. open/file, functions from os module)
    • databases
    • sockets
    • graphical display output

Examples to think about

  • Borg design pattern
  • dynamically changing class definitions, e.g. adding/replacing method definitions

Research material

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License