Problem with script and typing

Bjorn Pettersen bjorn at roguewave.com
Fri Jun 9 16:38:20 EDT 2000


"Thaddeus L. Olczyk" wrote:
[snip]
> OK. That solves the specific problem, but what about the typing
> problem. Since projects only contains instances of Projects,
> FindProject returns a Project. The compiler seems to complain
> that it doesn't know that what FindProject returns is a project.
> So I can't call specific methods on the return value.

FindProject only returns a project if it finds one.  If it doesn't you
fall off the end of the for loop, and the default value of 'None' is
returned.  Perhaps you should throw an exception if you didn't find
anything?

-- bjorn




More information about the Python-list mailing list