Fix bug where list like object not returning empty Index.
State: closed

- [x] closes #17101 
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
@TomAugspurger could you please share your thoughts, can you also help me locate the file where tests have to be added, i am sorry but i don't understand project structure completely. Thanks in advance.
I think a new test with the code from the original issue at the top-level of `pandas/tests/indexing/test_indexing.py` makes sense
Hello @sumanau7! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:







There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2019-08-20 19:14:09 UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=h1) Report
> Merging [#26471](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/b563d452f5d54a12677035bf550432c69c2b3155?src=pr&el=desc) will **decrease** coverage by `50.04%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/26471/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=tree)

```diff
@@             Coverage Diff             @@
##           master   #26471       +/-   ##
===========================================
- Coverage   91.75%    41.7%   -50.05%     
===========================================
  Files         174      174               
  Lines       50765    50765               
===========================================
- Hits        46578    21173    -25405     
- Misses       4187    29592    +25405
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `?` | |
| #single | `41.7% <100%> (-0.08%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `34.61% <100%> (-62.53%)` | :arrow_down: |
| [pandas/io/formats/latex.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvbGF0ZXgucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/sas/sas\_constants.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXNfY29uc3RhbnRzLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/core/groupby/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9jYXRlZ29yaWNhbC5weQ==) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tseries/plotting.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvcGxvdHRpbmcucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tseries/converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvY29udmVydGVyLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/formats/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvaHRtbC5weQ==) | `0% <0%> (-99.37%)` | :arrow_down: |
| [pandas/io/sas/sas7bdat.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXM3YmRhdC5weQ==) | `0% <0%> (-91.16%)` | :arrow_down: |
| [pandas/io/sas/sas\_xport.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXNfeHBvcnQucHk=) | `0% <0%> (-90.1%)` | :arrow_down: |
| [pandas/core/tools/numeric.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvdG9vbHMvbnVtZXJpYy5weQ==) | `10.14% <0%> (-89.86%)` | :arrow_down: |
| ... and [130 more](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=footer). Last update [b563d45...880790c](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=h1) Report
> Merging [#26471](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/d2031d76f739b069c8df0a93944bab2a9d5c8abd?src=pr&el=desc) will **increase** coverage by `49.14%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/26471/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=tree)

```diff
@@             Coverage Diff             @@
##           master   #26471       +/-   ##
===========================================
+ Coverage   42.56%   91.71%   +49.14%     
===========================================
  Files         189      178       -11     
  Lines       50059    50755      +696     
===========================================
+ Hits        21307    46548    +25241     
+ Misses      28752     4207    -24545
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.3% <100%> (?)` | |
| #single | `41.2% <100%> (-1.36%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.88% <100%> (+62.12%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-4.39%)` | :arrow_down: |
| [pandas/io/feather\_format.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2ZlYXRoZXJfZm9ybWF0LnB5) | `21.05% <0%> (-3.95%)` | :arrow_down: |
| [pandas/\_config/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL19jb25maWcvX19pbml0X18ucHk=) | `100% <0%> (ø)` | :arrow_up: |
| [pandas/core/api.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXBpLnB5) | `100% <0%> (ø)` | :arrow_up: |
| [pandas/io/msgpack/exceptions.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL21zZ3BhY2svZXhjZXB0aW9ucy5weQ==) | `83.33% <0%> (ø)` | :arrow_up: |
| [pandas/io/clipboard/windows.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2NsaXBib2FyZC93aW5kb3dzLnB5) | `11.11% <0%> (ø)` | :arrow_up: |
| [pandas/io/api.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2FwaS5weQ==) | `100% <0%> (ø)` | :arrow_up: |
| [pandas/core/arrays/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL19faW5pdF9fLnB5) | `100% <0%> (ø)` | :arrow_up: |
| [pandas/core/dtypes/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2dlbmVyaWMucHk=) | `100% <0%> (ø)` | :arrow_up: |
| ... and [178 more](https://codecov.io/gh/pandas-dev/pandas/pull/26471/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=footer). Last update [d2031d7...25a269b](https://codecov.io/gh/pandas-dev/pandas/pull/26471?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@TomAugspurger changing the behaviour is breaking few tests, i have fixed one of them if the approach is right, i can check what are the other places where tests are breaking and i can fix that.

Can you also share command on how can i run tests in individual files please, for example if i only want to run tests from file `test_partial.py` locally. 
can you merge master and update to comments
@jreback Is the PR ok ?
can you merge master and respond to comments
@sumanau7 there's a merge conflict. Can you update to fix it?
Merged master & addressed the comments. Let's see if CI passes.
@jbrockmendel can you give this a quick sanity check? Would be nice for 0.25.1.
The new test looks good to me, but it isn't obvious that the edited test needs to be changed (not that it is wrong, just not obviously needed)
Thanks @sumanau7!