> I'm reading a lot of python code lately, django code to be exact, and
> I keep bumping into expressions that look like this
> @register.filter
> 
> I see nothing importing @register, so I assume it's not just a
> function name. 

That can't be. register must be a bound name - not necessarily an
imported function; it could also be something being set through
assignment (register = Registry()).

> Yet I cannot figure where this @ sign came from.

That's a function decorator; see PEP 318.

Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to