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

set() is an instance of typing.Sized #33

Closed
mitar opened this issue Apr 5, 2018 · 3 comments
Closed

set() is an instance of typing.Sized #33

mitar opened this issue Apr 5, 2018 · 3 comments

Comments

@mitar
Copy link
Collaborator

mitar commented Apr 5, 2018

>>> import typing
>>> from pytypes import type_util
>>> type_util._isinstance(set(), typing.Sized)
False
>>> isinstance(set(), typing.Sized)
True

The first False is surprising. I would expect it to be True like isinstance is.

@Stewori
Copy link
Owner

Stewori commented Apr 5, 2018

Okay, like explained in #32 (comment), this is an issue with Empty. Currently pytypes only supports empty data structures w.r.t. Container. I'll think about how we can add support for Sized and Iterable (something else?)

@Stewori Stewori closed this as completed in 5736ecd Apr 5, 2018
@Stewori
Copy link
Owner

Stewori commented Apr 5, 2018

Fixed as of 5736ecd.
Todo: Tests.

@mitar
Copy link
Collaborator Author

mitar commented Apr 5, 2018

I didn't realize that this is associated with there being an empty set.

Thanks again for quick solutions.

@mitar mitar mentioned this issue Apr 5, 2018
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

2 participants