Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

func_noerror_decorator_scope.py 542B

12345678910111213141516171819
  1. # -*- pylint: disable=W0232,R0903
  2. """Test that decorators sees the class namespace - just like
  3. function default values does but function body doesn't.
  4. https://www.logilab.net/elo/ticket/3711 - bug finding decorator arguments
  5. https://www.logilab.net/elo/ticket/5626 - name resolution bug inside classes
  6. """
  7. from __future__ import print_function
  8. class Test(object):
  9. """test class"""
  10. ident = lambda x: x
  11. @ident(ident)
  12. def method(self, val=ident(7), func=ident):
  13. """hop"""
  14. print(self)
  15. return func(val)