[Tutor] If a method has no return type?
swordangel at gmail.com
Thu Feb 7 07:37:55 CET 2013
No method or function in Python has a *static* return type. That's
because Python is by nature a dynamic language, with duck typing and
dynamic dispatch. In fact, any method or function may well return any
of a number of different types:
It's probably bad design, but there is nothing in the Python grammar
and semantics that stops you from doing that.
So your question is better phrased as: if I don't explicitly return
anything, what is returned?
The answer to that would be: the None object
On 7 February 2013 14:09, Sunil Tech <sunil.techspk at gmail.com> wrote:
> If a method has no return type?
> what will it return?
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
More information about the Tutor