On Friday, 22 April 2016 15:41:29 UTC+1, Steven Crockett wrote:
>
>
> def scarico(request, data):
>     print(data)
>
> You are expecting two positional arguments, and no keyword arguments.
> To properly capture your keyword argument named "my_string" your 
> definition should be written as: 
>
> def scarico(request, my_string=''):
>     print(my_string)
>


Python doesn't make the distinction you imply between positional and 
keyword arguments in function definitions. It is always possible to pass an 
argument as a keyword, even if it is defined without a default. `def 
scarico(request, my_string)` is the correct signature here.
--
Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/27852d25-db39-4777-b55a-2ce17a253efa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to