4

I'm a Java developer and i'm really used to see when i forget to catch an exception, a message prompting on my IDE reminding me to do so.

Is there a similar thing on PyCharm for Django development?

Thanks a lot.

4
  • Which Ide that you used to, while developing Java code?
    – obayhan
    Commented Jul 31, 2014 at 14:12
  • Eclipse and Android Studio (IntelliJ based)
    – colletjb
    Commented Jul 31, 2014 at 14:23
  • Can you tell us how are you doing this in eclipse? Because eclipse has no atrribute like this by default or i misunderstand what you want.
    – obayhan
    Commented Jul 31, 2014 at 14:27
  • I mean something like this (with FileInputStream being red unlined) : w3resource.com/java-tutorial/images/types-of-exceptions1.png
    – colletjb
    Commented Jul 31, 2014 at 14:51

2 Answers 2

1

Java and Python behave differently, so with Java you need to explicitly handle each exception with a throws clause. This can be possible since Java is a statically typed language, and explicitly mentions exceptions.

Python on the on the other hand is dynamically typed, and so exception handling as to be handled by the user's discretion.

Sorry, but this feature just does not exist right now.

However, you can get PyCharm to pause on a runtime exception, by hitting the debug button instead os running it.

1

This comes from java's itself. Java methods have throws declaration but python methods has not. Ide handles this. Not sure but it seems not possible.

Not the answer you're looking for? Browse other questions tagged or ask your own question.