Bret <[EMAIL PROTECTED]> writes:
> nextport=42000
> 
> def getNextPort():
>     nextport += 1
>     return nextport

If you have to do it that way, use:

    def getNextPort():
        global nextport
        nextport += 1
        return nextport

the global declaration stops the compiler from treating nextport as
local and then trapping the increment as to an uninitialized variable.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to