Skip to main content
Active reading [<en.wikipedia.org/wiki/Java_virtual_machine> <en.wikipedia.org/wiki/Duck_typing>]. [(its = possessive, it's = "it is"] (References to relative positions of answers are not reliable as they depend on the view (votes/oldest/active), etc.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

While in Java itsit's indeed a bad practice to use Exceptionsexceptions for flow control (mainly because exceptions force the jvmJVM to gather resources (more here)), in Python you have 2two important principles: Duck Typingduck typing and EAFP. This basically means that you are encouraged to try using an object the way you think it would work, and handle when things are not like that.

In summary, the only problem would be your code getting too much indented. If you feel like it, try to simplify some of the nestings, like lqc suggested in the suggested answer above.

While in Java its indeed a bad practice to use Exceptions for flow control (mainly because exceptions force the jvm to gather resources (more here)), in Python you have 2 important principles: Duck Typing and EAFP. This basically means that you are encouraged to try using an object the way you think it would work, and handle when things are not like that.

In summary the only problem would be your code getting too much indented. If you feel like it, try to simplify some of the nestings like lqc suggested in the suggested answer above.

While in Java it's indeed a bad practice to use exceptions for flow control (mainly because exceptions force the JVM to gather resources (more here)), in Python you have two important principles: duck typing and EAFP. This basically means that you are encouraged to try using an object the way you think it would work, and handle when things are not like that.

In summary, the only problem would be your code getting too much indented. If you feel like it, try to simplify some of the nestings, like lqc suggested in the suggested answer above.

While in Java its indeed a bad practice to use Exceptions for flow control (mainly because exceptions force the jvm to gather resources (more here)), in Python you have 2 important principles: Duck Typing and EAFP. This basically means that you are encouraged to try using an object the way you think it would work, and handle when things are not like that.

In summary the only problem would be your code getting too much indented. If you feel like it, try to simplify some of the nestings like lqclqc suggested in the suggested answer above.

While in Java its indeed a bad practice to use Exceptions for flow control (mainly because exceptions force the jvm to gather resources (more here)), in Python you have 2 important principles: Duck Typing and EAFP. This basically means that you are encouraged to try using an object the way you think it would work, and handle when things are not like that.

In summary the only problem would be your code getting too much indented. If you feel like it, try to simplify some of the nestings like lqc suggested

While in Java its indeed a bad practice to use Exceptions for flow control (mainly because exceptions force the jvm to gather resources (more here)), in Python you have 2 important principles: Duck Typing and EAFP. This basically means that you are encouraged to try using an object the way you think it would work, and handle when things are not like that.

In summary the only problem would be your code getting too much indented. If you feel like it, try to simplify some of the nestings like lqc suggested in the suggested answer above.

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

While in Java its indeed a bad practice to use Exceptions for flow control (mainly because exceptions force the jvm to gather resources (more heremore here)), in Python you have 2 important principles: Duck Typing and EAFP. This basically means that you are encouraged to try using an object the way you think it would work, and handle when things are not like that.

In summary the only problem would be your code getting too much indented. If you feel like it, try to simplify some of the nestings like lqc suggested

While in Java its indeed a bad practice to use Exceptions for flow control (mainly because exceptions force the jvm to gather resources (more here)), in Python you have 2 important principles: Duck Typing and EAFP. This basically means that you are encouraged to try using an object the way you think it would work, and handle when things are not like that.

In summary the only problem would be your code getting too much indented. If you feel like it, try to simplify some of the nestings like lqc suggested

While in Java its indeed a bad practice to use Exceptions for flow control (mainly because exceptions force the jvm to gather resources (more here)), in Python you have 2 important principles: Duck Typing and EAFP. This basically means that you are encouraged to try using an object the way you think it would work, and handle when things are not like that.

In summary the only problem would be your code getting too much indented. If you feel like it, try to simplify some of the nestings like lqc suggested

added alt text to links
Source Link
Tobias Kienzler
  • 27.8k
  • 23
  • 138
  • 232
Loading
Source Link
Bruno Penteado
  • 2.3k
  • 2
  • 23
  • 26
Loading