Changes between Version 1 and Version 2 of Ticket #21077, comment 1
- Timestamp:
- Oct 26, 2013, 3:45:52 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #21077, comment 1
v1 v2 7 7 1. 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. 8 8 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.9 2. 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. 10 10 11 11 It 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.