On Nov 17, 1:24 pm, Ethan Furman <et...@stoneleaf.us> wrote: > If you do need to sometimes call it from a method then still leave off > the '@staticmethod', and give 'self' a default of 'None': > > def _get_next_id(self=None): > [blah, blah, blah] > return id > > user_id = IntField(required=True, default=_get_next_id)
And if the OP needs it to be a staticmethod as well, he can just wrap the nested function: gen_next_id = staticmethod(_gen_next_id) I think I like this approach best. I'm annoyed that I forgot functions declared in a class scope were callable within the definition :) -- http://mail.python.org/mailman/listinfo/python-list