New submission from anatoly techtonik <techto...@gmail.com>:

It is an error to try to inherit from function and the error message in 
this case is:
{{{
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "m:\p\pb.py", line 4, in <module>
    class PostgreSQLConnection(DatabaseConnection):
TypeError: Error when calling the metaclass bases
    function() argument 1 must be code, not str
}}}

Something like 'Impossible to inherit from function' will clear 
confusion state from users unfamiliar with metaclasses.
{{{
def DatabaseConnection(object):
    pass

class PostgreSQLConnection(DatabaseConnection):
    pass
}}}

----------
components: Interpreter Core
messages: 92191
nosy: techtonik
severity: normal
status: open
title: Frendly error message when inheriting from function
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6829>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to