On Monday, 17 October 2011 12:18:00 UTC+1, youpsla wrote: > > hello again, sorry for eventually annoying. But later in the Django > tutorial, > > there is this code: > > from django.conf.urls import patterns, include, url > ..................................... > urlpatterns = patterns('', > (r'^polls/$', 'polls.views.index'), > ......................)), > ) > > What I understand here is that "patterns", "include" and "url" modules > are imported. > > After the result of the function "patterns" is assigned to > "urlpatterns". AS Daniel said that a function can't be imported, this > means that a method can be called (but not imported) or this means > that a function and a method are not the same thing ? > > Regards > > Alain >
I didn't say that a function can't be imported. It definitely can. As you say, function and method aren't the same thing - a method is a function that belongs to a class. It's not possible to import just a method, because there's no way of referring to it except via the class. But anything at the base level of a module - whether it's a class, a function, a variable, anything - *can* be imported. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/hRGc9Z5seJkJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.