CLN refactor core dtypes
Some refactorings found by Sourcery https://sourcery.ai/

I've removed the ones of the kind
```diff
- if param:
-     var = a
- else:
-     var = b
+ var = a if param else b
```
look ok. these may have broken things.  Indeed - the refactoring
```diff
-    if len(types) == 0:
+    if not types:
```
was wrong, as `types` could be a `Series` here (as in the test `pandas/tests/arrays/sparse/test_accessor.py::TestFrameAccessor::test_to_coo`), in which was `not types` raises
```
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
```

Have fixed up and changed the annotation can you merge master ping on green > can you merge master ping on green

Green, barring (probably unrelated?) travis error:
```
____________________________ test_deprecated_kwargs ____________________________

[gw0] linux -- Python 3.7.8 /home/travis/miniconda3/envs/pandas-dev/bin/python

    def test_deprecated_kwargs():

        df = pd.DataFrame({"A": [2, 4, 6], "B": [3, 6, 9]}, index=[0, 1, 2])

        buf = df.to_json(orient="split")

        with tm.assert_produces_warning(FutureWarning):

>           tm.assert_frame_equal(df, read_json(buf, "split"))

pandas/tests/io/json/test_deprecated_kwargs.py:15: 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <contextlib._GeneratorContextManager object at 0x7fc4d8ce5110>

type = None, value = None, traceback = None

    def __exit__(self, type, value, traceback):

        if type is None:

            try:

>               next(self.gen)

E               AssertionError: Caused unexpected warning(s): [('ResourceWarning', ResourceWarning("unclosed <ssl.SSLSocket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('10.20.0.66', 55192), raddr=('52.216.144.227', 443)>"), '/home/travis/build/pandas-dev/pandas/pandas/core/dtypes/base.py', 435), ('ResourceWarning', ResourceWarning("unclosed file <_io.BufferedWriter name='/tmp/tmpnm7c5epi.xls'>"), '/home/travis/build/pandas-dev/pandas/pandas/core/dtypes/base.py', 435), ('ResourceWarning', ResourceWarning("unclosed file <_io.BufferedWriter name='/tmp/tmplgig23ur.xlsx'>"), '/home/travis/build/pandas-dev/pandas/pandas/core/dtypes/base.py', 435)]

../../../miniconda3/envs/pandas-dev/lib/python3.7/contextlib.py:119: AssertionError
``` moving off 1.2 until ready Sure, no problem (though as far as I can tell, this is ready - anything else need changing?) > Sure, no problem (though as far as I can tell, this is ready - anything else need changing?)

I think it was fine, just want to make sure after merge sure, have merged thanks @MarcoGorelli 