BUG: Stack/unstack do not return subclassed objects (GH15563)
State: closed

- [x] closes #15563
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

Basically picked from #15655 to support stack/unstack in subclassed DataFrames and Series.


Labels:
name: Bug
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Compat
description: pandas objects compatability with Numpy or Python functions

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

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

```diff
@@            Coverage Diff             @@
##           master   #18929      +/-   ##
==========================================
+ Coverage   91.52%   91.54%   +0.02%     
==========================================
  Files         147      147              
  Lines       48775    48775              
==========================================
+ Hits        44639    44651      +12     
+ Misses       4136     4124      -12
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.91% <100%> (+0.02%)` | :arrow_up: |
| #single | `41.62% <8.33%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18929?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/melt.py](https://codecov.io/gh/pandas-dev/pandas/pull/18929/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9tZWx0LnB5) | `97.19% <100%> (-0.06%)` | :arrow_down: |
| [pandas/core/reshape/reshape.py](https://codecov.io/gh/pandas-dev/pandas/pull/18929/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9yZXNoYXBlLnB5) | `100% <100%> (ø)` | :arrow_up: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/18929/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `66.95% <0%> (+1.73%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18929?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/18929?src=pr&el=footer). Last update [8acdf80...16d82c5](https://codecov.io/gh/pandas-dev/pandas/pull/18929?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Hello @rockg! Thanks for updating the PR.









Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on January 11, 2018 at 14:08 Hours UTC
Tried to incorporate obj into `_Unstacker`.  Take a look.  When there's a mixed frame being unstacked the underlying blocks are unstacked and so passing obj doesn't really work.  However, for that case the constructors aren't used but applied later.
can you revert back to what you had. that was ok for now. its not as clear this way.
All green.
thanks @rockg