>>Point 1. No you can't have such names but it is not CP's fault. CP2 is a
>>Python module and thus follows Python's rules, which means that you
>>cannot use reserved keywords for something different from their purpose.
>>You would get some strange behavior.
>
> Thanks for the responses.
>
> The behavior will be a module that has a syntax error :) However, what
> if I want to publish a "http:/
mysite.com/class" url ? I think there
> should be a way to do it, and having a function attribute comes to mind.
> Something like:
>
> def _class():
> ...
>
> _class.exposed = True
> _class.expose_name = 'class'
>
>
> Am I allowed to send a patch to do this ? Is anyone else interested in
> this functionality ? Obviously, the same should be implmented to the
> "published" attribute.
I think it's a good idea to have an easy way to set the "expose_name".
This will be a nice workaround for python's variable name limitations
that don't exist in URLs.
That would provide an easy way to dynamically serve robots.txt and
favicon.ico for instance.
However, I think this is part of a more general discussion that should
also include the verbs and other things...
Right now, you can only tell CherryPy "expose this object", whereas it
would be more flexible to be able tell it "expose this object under that
name, for these verbs"
I just want to make sure we have a generic way of supporting these
features before we start adding more and more attributes ...
There will be a discussion about this in the next IRC session.
Remi.