Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment to __class__ is broken #6

Closed
tseaver opened this issue Jan 11, 2015 · 1 comment · Fixed by #176
Closed

Assignment to __class__ is broken #6

tseaver opened this issue Jan 11, 2015 · 1 comment · Fixed by #176
Labels

Comments

@tseaver
Copy link
Member

tseaver commented Jan 11, 2015

In https://bugs.launchpad.net/zope.interface/+bug/180844, @jimfulton reports:

See: http://mail.zope.org/pipermail/interface-dev/2008-January/000192.html

Here's an example that provides the basis for a test case:

>>> import zope.interface.interface
>>> class InterfaceClass(zope.interface.interface.InterfaceClass):
...     def __call__(self, *args):
...         print 'called', self, args
...
>>> IFoo = InterfaceClass('IFoo', (zope.interface.Interface,))
>>> IFoo(1)
called <InterfaceClass __main__.IFoo> (1,)
>>> class IBar(IFoo): pass
...
>>> IBar()
called <InterfaceClass __main__.IBar> ()
>>> class ISpam(zope.interface.Interface): pass
...
>>> ISpam()
Traceback (most recent call last):
    File "<console>", line 1, in ?
TypeError: function takes at least 1 argument (0 given)
>>> ISpam.__class__ = InterfaceClass
>>> ISpam()
Traceback (most recent call last):
    File "<console>", line 1, in ?
TypeError: function takes at least 1 argument (0 given)
@tseaver tseaver added the bug label Jan 11, 2015
@jamadden
Copy link
Member

jamadden commented Feb 6, 2020

This works as requested using the pure-Python implementation but fails with the C accelerator.

jamadden added a commit that referenced this issue Feb 14, 2020
It seems to be working now, so this fixes #6
jamadden added a commit that referenced this issue Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants