home / django_tickets / tickets

tickets: 22078

This data as json

id created changetime last_pulled_from_trac stage status component type severity version resolution summary description owner reporter keywords easy has_patch needs_better_patch needs_tests needs_docs ui_ux
22078 2014-02-17 15:35:17 2017-03-17 14:48:23 2022-03-06 04:18:08.401314 Accepted assigned contrib.syndication Bug Normal 1.6   views.Feed methods cannot be decorated If one applies a decorator on a method which is called by `__get_dynamic_attr` a `TypeError` like this occurs: {{{ Exception Type: TypeError at /blog/feed/ Exception Value: item_link() takes exactly 2 arguments (1 given) }}} I think this is because `__get_dynamic_attr` tries to count the function's arguments, but decorators usally get defined with the `*args, **kwargs` syntax, so this trick does not work here. {{{ if code.co_argcount == 2: # one argument is 'self' return attr(obj) else: return attr() }}} I think the best approach would be to remove one of the two methods. IMHO We should have either `attr(item)` or `attr()` not both, as "there should be one, and preferably only one, obvious way to do it". coldmind tyrion   0 0 0 0 0 0
Powered by Datasette · Queries took 1.238ms