- by ts
Hello
I am trying to make a list of things which can be difficult/surprising to someone who is changing language from PHP to Python.
so far i have rather short list:
forget require / include, learn import (this was most difficult to me - to understand package - module - class - object hierarchy and its mapping to filesystem)
you can't just upload file on server to have webpage (-mod_python, wsgi etc)
learn the python way for use variable class names (new $class() vs import + getattr)
/ operator in python 2.x and all float-related horrors
those were difficult to me, it takes few days before mind adapts a new paradigm
after i found that there is few other areas which could be challenging for someone with (too) many years of php:
everything is an object
you have to live with exceptions
array vs list, set, dictionary, tuple ...
learn (effective) list comprehensions
learn generators
any other ideas / personal experiences ?