"Amit Sethi" <amit.pureene...@gmail.com> wrote
I think ideally i want a compile Error just like java ..

I think you are trying to make Python act like Java which is always a really bad mistake when using a programming language. As Bjarne Stroustrup used to say (repeatedly) "C++ is not Smalltalk". And Python is not Java.

If you stop trying to design like Java and start using the extra power of Python you will find your solutions are both more flexible and more simple.

Python does not compile so trying to build in "compile time" checking makes no sense. You could do some checks immediately after class definition or more likely class assignment but how would it really benefit you?

Get used to how interpreted dynamic languages work and use their features to your benefit instead of trying to force them to act like statically typed compiled languages. It will give you a great sense of freedom!


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to