Or it may be well:

@request.get()
> @request.post()
> def api(): return dict()


As he is a decorator, avoid ambiguities and thus would be more clear the
code.
_____________________________________________
*Gilson Filho*
*Web Developer
http://gilsondev.com*



2011/3/13 Massimo Di Pierro <massimo.dipie...@gmail.com>

> Because I would know how to do
>
> @request.get()
> def api(): return dict()
>
> @request.post()
> def api(): return dict()
>
> i.e. have two functions with the same name and select one or the other
> without ambiguity.
>
> On Mar 13, 9:04 am, "contatogilson...@gmail.com"
> <contatogilson...@gmail.com> wrote:
> > Would not it be better to do this?
> >
> > @request.get()
> > <@request.post()>
> > <@request.put()>
> > <@request.delete()>
> > def api():
> >     (...)
> >     return dict(...)
> >
> > _____________________________________________
> > *Gilson Filho*
> > *Web Developerhttp://gilsondev.com*

Reply via email to