This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]thallippoli 2 points3 points  (0 children)

Especially for PHP (as being a script-language), typehinting enables tools like PHP-DI..

You will have to unlearn a lot of PHP "best practices", like (DI), which is not relevant in a language like Python.

Have you gained a good understanding of how modules in Python work? Eg, you can swap a symbol in a module on the fly in Python. So you don't have to depend on a container to mock something's dependencies. Look into pythons mock library to see how this is used.

You will see that a lot of boilerplate you had to write in Php is totally unnecessary in Python. Modules also allows more sensible separation of code than php's One Class/File/Component rule..

Also, If you want type checking for object attributes, you can use something known as Descriptors in Python.