mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
* Lots of small changes related to access.
* Added "access *: ...", made access work for class methods. * Introduced subclass check: make sure that when calling ClassName.methodname(instance, ...), the instance is an instance of ClassName or of a subclass thereof (this might break some old code!)
This commit is contained in:
parent
81daa32c15
commit
b3f7258f14
7 changed files with 112 additions and 49 deletions
|
@ -105,10 +105,10 @@ meth_repr(m)
|
|||
{
|
||||
char buf[200];
|
||||
if (m->m_self == NULL)
|
||||
sprintf(buf, "<built-in function '%.80s'>", m->m_name);
|
||||
sprintf(buf, "<built-in function %.80s>", m->m_name);
|
||||
else
|
||||
sprintf(buf,
|
||||
"<built-in method '%.80s' of %.80s object at %lx>",
|
||||
"<built-in method %.80s of %.80s object at %lx>",
|
||||
m->m_name, m->m_self->ob_type->tp_name,
|
||||
(long)m->m_self);
|
||||
return newstringobject(buf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue