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

AttributeError when calling 'discard' on copy of 'TraitSetObject' #97

Closed
cfarrow opened this issue Nov 20, 2013 · 0 comments · Fixed by #98
Closed

AttributeError when calling 'discard' on copy of 'TraitSetObject' #97

cfarrow opened this issue Nov 20, 2013 · 0 comments · Fixed by #98

Comments

@cfarrow
Copy link
Contributor

cfarrow commented Nov 20, 2013

Here's how to reproduce this.

from traits.api import HasTraits, Set


class Test(HasTraits):
    s = Set()

    def fail(self):
        s = self.s.copy()
        # Point of failure
        s.discard('foo')

t = Test(s=set(['foo', 'bar']))
t.fail()
rkern added a commit that referenced this issue Nov 20, 2013
Otherwise, an uninitialized TraitSetObject is returned, and operations on it
will fail.

Fixes #97.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant