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

Python 3 Compatability #2

Open
baxelrod-bdai opened this issue Aug 27, 2012 · 0 comments
Open

Python 3 Compatability #2

baxelrod-bdai opened this issue Aug 27, 2012 · 0 comments

Comments

@baxelrod-bdai
Copy link

I believe this one-line change (plus an added import) is all that is required for Python3 compatability. The second to last line in the Collection class is the only change, but it requires the collections module.

import collections
...
class _Collection(_Call):
    """Base class to expose entities methods to main object."""
    def __init__(self,entities=[]):
        self.entities=copy.copy(entities)
        #link entities methods to drawing
        for attr in dir(self.entities):
            if attr[0]!='_':
                attrObject=getattr(self.entities,attr)
                if isinstance(attrObject, collections.Callable):
                    setattr(self,attr,attrObject)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant