Changes between Version 1 and Version 2 of Ticket #21077, comment 1


Ignore:
Timestamp:
Oct 26, 2013, 3:45:52 AM (11 years ago)
Author:
Kevin Christopher Henry

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21077, comment 1

    v1 v2  
    771. Only allow valid Python identifiers to be named arguments in `simple_tag` tags. If users want something else they'll have to forgo using `simple_tag`. This isn't backwards compatible, though, and is more restrictive than we might like.
    88
    9 2. Allow named arguments to be invalid Python identifiers, acknowledging that users can simply use `**kwargs` in their function signatures. In this case, I agree with semenov that we should be more permissive in what we accept; in particular, I don't see any reason to outlaw dashes. This is backwards compatible and more functional, though it seems hackish that only the `**kwargs` style of function signature can be used with named arguments that aren't Python identifiers.
     92. Allow named arguments to be invalid Python identifiers, acknowledging that template tag authors can simply use `**kwargs` in their function signatures. In this case, I agree with semenov that we should be more permissive in what we accept; in particular, I don't see any reason to outlaw dashes. This is backwards compatible and more functional, though it seems hackish that only the `**kwargs` style of function signature can be used with named arguments that aren't Python identifiers.
    1010
    1111It looks like this same regular expression is used for other tags with keyword arguments (`with`, `include`, `blocktrans`, `url`) so it's probably worth thinking about any implications for those cases as well.
Back to Top