Skip to content

Fallback Enum class and boolean index fix#35

Closed
pavanky wants to merge 0 commit intoarrayfire:masterfrom
pavanky:master
Closed

Fallback Enum class and boolean index fix#35
pavanky wants to merge 0 commit intoarrayfire:masterfrom
pavanky:master

Conversation

@pavanky
Copy link
Member

@pavanky pavanky commented Sep 8, 2015

@pavanky pavanky mentioned this pull request Sep 8, 2015
@FilipeMaia
Copy link
Contributor

The name Enum_value does not match the other functions. Its use also looks a bit clunky...

@pavanky
Copy link
Member Author

pavanky commented Sep 9, 2015

@FilipeMaia Enum_value is a place holder for now. It is easy to grep and replace for any future changes.

@FilipeMaia
Copy link
Contributor

Instead of having an Enum_value causing changes all over the code what about changing the way the enums are defined, e.g.:

try:
    from enum import Enum    
    def EnumType(v):
        return v
except:
    class Enum(object):
        pass
    class EnumType(object):
        def __init__(self, v):
            self.value = v

class Dtype(Enum):
    """
    Error values. For internal use only.
    """
    f32 = EnumType(0)
    ...

That way all the changes would be in the same place.

@pavanky
Copy link
Member Author

pavanky commented Sep 9, 2015

@FilipeMaia That would work.

@pavanky
Copy link
Member Author

pavanky commented Sep 9, 2015

Fixed the Enum class, looking into the Index class issue.

@pavanky
Copy link
Member Author

pavanky commented Sep 9, 2015

Welp, its broken. Fixing hit.

@pavanky
Copy link
Member Author

pavanky commented Sep 9, 2015

Accidentally pushed to upstream :( I will fix the index issue in upstream shortly.

@FilipeMaia
Copy link
Contributor

Ok

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

Successfully merging this pull request may close these issues.

2 participants