Implement delegate_names to allow decorating delegated attributes
State: closed

This PR defines a `delegate_names` decorator that provides an alternative (and to my taste, much nicer) syntax for pinning delegated attributes to Accessor classes.

Effectively this just moves the call to `_add_delegate_accessors` from after the class definition to a decorator on the class.  I find this much harder to overlook when reading a class definition.

- [ ] closes #xxxx
- [ ] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Enhancement
name: Refactor
description: Internal refactoring of code
name: ExtensionArray
description: Extending pandas with custom dtypes or arrays.

Comments:
Hello @jbrockmendel! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/core/accessor.py`](https://github.com/jbrockmendel/pandas/blob/7c31f5b323616bdd2313d85b11beb33a339a4fa6/pandas/core/accessor.py) !

 - There are no PEP8 issues in the file [`pandas/core/arrays/categorical.py`](https://github.com/jbrockmendel/pandas/blob/7c31f5b323616bdd2313d85b11beb33a339a4fa6/pandas/core/arrays/categorical.py) !

 - There are no PEP8 issues in the file [`pandas/core/indexes/accessors.py`](https://github.com/jbrockmendel/pandas/blob/7c31f5b323616bdd2313d85b11beb33a339a4fa6/pandas/core/indexes/accessors.py) !

 - There are no PEP8 issues in the file [`pandas/core/indexes/category.py`](https://github.com/jbrockmendel/pandas/blob/7c31f5b323616bdd2313d85b11beb33a339a4fa6/pandas/core/indexes/category.py) !


If you fetch and merge master the CI failures should be fixed.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22599?src=pr&el=h1) Report
> Merging [#22599](https://codecov.io/gh/pandas-dev/pandas/pull/22599?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/e2e1a1051576a48f210ce17272fc24b90ebcf24a?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #22599      +/-   ##
==========================================
+ Coverage   92.04%   92.04%   +<.01%     
==========================================
  Files         169      169              
  Lines       50782    50785       +3     
==========================================
+ Hits        46742    46745       +3     
  Misses       4040     4040
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.45% <100%> (ø)` | :arrow_up: |
| #single | `42.3% <100%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22599?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/22599/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2NhdGVnb3JpY2FsLnB5) | `95.74% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/accessors.py](https://codecov.io/gh/pandas-dev/pandas/pull/22599/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9hY2Nlc3NvcnMucHk=) | `90.09% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/category.py](https://codecov.io/gh/pandas-dev/pandas/pull/22599/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9jYXRlZ29yeS5weQ==) | `97.26% <100%> (-0.02%)` | :arrow_down: |
| [pandas/core/accessor.py](https://codecov.io/gh/pandas-dev/pandas/pull/22599/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYWNjZXNzb3IucHk=) | `98.79% <100%> (+0.07%)` | :arrow_up: |

------

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

thanks @jbrockmendel