Defining URIObjects with a metaclass
Bug #80116 reported by
Marius Gedminas
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SchoolTool |
Confirmed
|
Wishlist
|
Justas Sadzevičius |
Bug Description
Instead of saying
URIMembership = URIObject(...)
I want to say
class URIMembership(
url = '...'
...
and get the same result (i.e. URIMembership should be an instance of class
URIObject with the same attributes set).
It would be very nice if I could say 'class URIFoo(URIObject)' and get an
instance, not a subclass, so that I wouldn't have to remember two different names.
The reason for my wish is that exuberant ctags doesn't index global variables in
Python code, so I cannot use jump-to-tag or tag-completion on URIs.
Sane people might veto this request on the grounds that it is too magical.
Changed in schooltool: | |
assignee: | nobody → ignas |
status: | In Progress → Confirmed |
tags: | added: api code-cleanup |
Changed in schooltool: | |
assignee: | Ignas Mikalajūnas (ignas) → Justas Sadzevičius (justas-pov) |
To post a comment you must log in.
+1