Skip to content

Deprecated built-in function __getslice__ in python 3.7 to get a slice from a list #53

@gorhan

Description

@gorhan

To get the interval of a list object is handled inside the getitem built-in function. Since it only checks whether given parameter to this function is int or not, the slice objects enters the else statement which causes a problem. Possible Fix:

def __getitem__(self, expr):
    if type(expr) is int or type(expr) is slice:
        return list.__getitem__(self, expr)
    else:
        return Element(self, expr)

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions