Issue2581

classification
Title: getmro omits classes of the same name
Type: behaviour Severity: normal
Components: Library Versions: Jython 2.7
Milestone:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: jaraco, zyasoft
Priority: Keywords:

Created on 2017-04-27.01:38:07 by jaraco, last changed 2017-05-19.03:08:17 by zyasoft.

Messages
msg11326 (view) Author: Jason R. Coombs (jaraco) Date: 2017-04-27.01:38:06
As discovered in https://github.com/pypa/setuptools/issues/1024#issuecomment-297586140, invoking inspect.getmro on a class whose bases include two or more classes with the same __name__ will return only the first one encountered. This script demonstrates the issue:

class OtherNamespace:
	class Y:
		pass

class Y:
 pass

class Z(OtherNamespace.Y, Y):
 pass

import inspect

print(inspect.getmro(Z))
msg11385 (view) Author: Jim Baker (zyasoft) Date: 2017-05-19.03:08:16
Very interesting. Likely an easy fix by being more precise - identity vs name.
History
Date User Action Args
2017-05-19 03:08:17zyasoftsetnosy: + zyasoft
messages: + msg11385
2017-04-27 01:38:07jaracocreate