On Friday, October 14, 2016 at 12:06:36 AM UTC+1, pozz wrote:
> I come from the C language, that is a compiled and strongly typed 
> language.

Python is compiled and dynamically and strongly typed but C is compiled and 
statically and weakly typed.

> All the tricks have a common goal: to discover bugs as soon as possible, 
> mostly during compilation process. Indeed I usually find some bugs 
> during compilation (or static analysis). It seems to me very important.

As others have all ready mentioned there are plenty of static analysis tools 
for Python.

> Now I'm learning Python and it appears to me very simple, but at the 
> same time highly dangerous. For example, I can write a function that 
> accepts two arguments and call it with only one argument. I can execute 
> the script without any problem and I will not notice the bug until I 
> test exactly the erroneous line of code (the call with only one argument).

On the other hand some errors occur far less frequently in Python than in C, 
for example off-by-one, or the memory management being done for you.

> However, I think the language interpreter could emit the error before 
> launching the script even without executing the wrong instruction, 
> because it perfectly knows how many arguments the function wants and 
> that one instruction calls it with a wrong number of arguments.
> Are the things exactly how I understood, or do I miss something in Python?

You've missed plenty but please stick with it, you'll learn :)

Kindest regards.

Mark Lawrence.

Reply via email to