Update README.md

switched to magic methods in code example