Saturday, 17 August 2013

Python : Java throws equivalent in python

Python : Java throws equivalent in python

Not attempting to compare the languages but just for knowledge,
Is there any way to have equivalent of java throws keyword/functionality
in Python?
or the way we can recognize checked exception thrown by any method at
static time?
or Passing(chaining) exception handling responsibility?
Java:
public void someMethod() throws SomeException
{
}
Python:
@someDecorator # any way to do?
def someMethod():
pass

No comments:

Post a Comment