Fix: Allows a feature to be named "_type"
{'login': 'dcfidalgo', 'id': 15979778, 'node_id': 'MDQ6VXNlcjE1OTc5Nzc4', 'avatar_url': 'https://avatars.githubusercontent.com/u/15979778?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/dcfidalgo', 'html_url': 'https://github.com/dcfidalgo', 'followers_url': 'https://api.github.com/users/dcfidalgo/followers', 'following_url': 'https://api.github.com/users/dcfidalgo/following{/other_user}', 'gists_url': 'https://api.github.com/users/dcfidalgo/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/dcfidalgo/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/dcfidalgo/subscriptions', 'organizations_url': 'https://api.github.com/users/dcfidalgo/orgs', 'repos_url': 'https://api.github.com/users/dcfidalgo/repos', 'events_url': 'https://api.github.com/users/dcfidalgo/events{/privacy}', 'received_events_url': 'https://api.github.com/users/dcfidalgo/received_events', 'type': 'User', 'site_admin': False}
[]
[]
['Nice thank you !\r\nThis looks like a pretty simple yet effective fix ;)\r\nCould you just add a test in `test_features.py` to make sure that you can create `features` with a `_type` field and that it is possible to convert it as a dict and reload it ?\r\n```python\r\nfrom datasets import Features, Value\r\n\r\n# We usually use `asdict` on a `DatasetInfo` object which is a dataclass instance that contains the features.\r\n# So we need the conversion of features to dict to work.\r\n# You can test that using `dataclasses._asdict_inner`.\r\n# This is the function used by `dataclasses.asdict` to convert a dataclass instance attribute to a dict\r\nfrom dataclasses import _asdict_inner  \r\n\r\nf = Features({"_type": Value("string")})\r\nreloaded_f = Features.from_dict(_asdict_inner(f, dict))\r\nassert reloaded_f == f\r\n```'
 'Sure, i will add a test. \r\nOne question: are the posted benchmarks reliable? The extra type check seems to add quite some overhead judging by the relative differences. Do you think this is an issue?'
 'The benchmark has a bit of noise, the values are fine ;)\r\nespecially in the change you did since the overhead added is negligible.'
 'Ok, i added the test you described above. \r\n\r\nI avoided importing the private `_asdict_inner` method and directly used the `DatasetInfo` class, if this is ok with you. Thanks a lot for your support during this PR!']
{'url': 'https://api.github.com/repos/huggingface/datasets/pulls/2093', 'html_url': 'https://github.com/huggingface/datasets/pull/2093', 'diff_url': 'https://github.com/huggingface/datasets/pull/2093.diff', 'patch_url': 'https://github.com/huggingface/datasets/pull/2093.patch', 'merged_at': datetime.datetime(2021, 3, 25, 14, 35, 54)}
This PR tries to fix issue #1110. Sorry for taking so long to come back to this.

It's a simple fix, but i am not sure if it works for all possible types of `obj`. Let me know what you think @lhoestq 
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/2093/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}