Repository: pandas-dev/pandas

Issue:
pd.isnull() raises AttributeError on Pandas type objects
```python
import pandas as pd

x = pd.Series([1,2,3,4])
xt = type(x)
pd.isnull(xt)
## Traceback (most recent call last):
##   File "<input>", line 1, in <module>
##   File "/home/bbassett/venv37/lib/python3.7/site-packages/pandas/core/dtypes/missing.py", line 122, in isna
##     return _isna(obj)
##   File "/home/bbassett/venv37/lib/python3.7/site-packages/pandas/core/dtypes/missing.py", line 145, in _isna_new
##     return _isna_ndarraylike(obj)
##   File "/home/bbassett/venv37/lib/python3.7/site-packages/pandas/core/dtypes/missing.py", line 225, in _isna_ndarraylike
##     dtype = values.dtype
## AttributeError: 'property' object has no attribute 'dtype'

y = pd.DataFrame({"col": [1,2,3,4]})
yt = type(y)
pd.isnull(yt)
## Traceback (most recent call last):
##   File "<input>", line 1, in <module>
##   File "/home/bbassett/venv37/lib/python3.7/site-packages/pandas/core/dtypes/missing.py", line 122, in isna
##     return _isna(obj)
##   File "/home/bbassett/venv37/lib/python3.7/site-packages/pandas/core/dtypes/missing.py", line 147, in _isna_new
##     return obj._constructor(obj._data.isna(func=isna))
## AttributeError: 'NoneType' object has no attribute 'isna'

```
#### Problem description

I'm using a list comprehension and `pd.isnull()` to remove empty items from a list (`[x for x in l if not pd.isnull(x)]`).  When one of my users passes a pandas `type` object to this logic, it gums up the works by raising an AttributeError.  This logic works as expected with `type` objects from Python's builtins:

```python
import pandas as pd

z = "This is a test."
zt = type(z)
pd.isnull(zt)
## False
```

#### Expected Output

Both calls to `pd.isnull()` above should return `False`.  The type objects are not null/`None`/`NaN`/missing.

#### Output of ``pd.show_versions()``

<details>

INSTALLED VERSIONS
------------------
commit           : None
python           : 3.7.3.final.0
python-bits      : 64
OS               : Linux
OS-release       : 4.19.0-5-amd64
machine          : x86_64
processor        : 
byteorder        : little
LC_ALL           : None
LANG             : en_US.UTF-8
LOCALE           : en_US.UTF-8

pandas           : 0.25.0
numpy            : 1.16.4
pytz             : 2019.1
dateutil         : 2.8.0
pip              : 19.1.1
setuptools       : 41.0.1
Cython           : None
pytest           : None
hypothesis       : None
sphinx           : None
blosc            : None
feather          : None
xlsxwriter       : None
lxml.etree       : None
html5lib         : None
pymysql          : None
psycopg2         : None
jinja2           : None
IPython          : None
pandas_datareader: None
bs4              : None
bottleneck       : None
fastparquet      : None
gcsfs            : None
lxml.etree       : None
matplotlib       : None
numexpr          : None
odfpy            : None
openpyxl         : None
pandas_gbq       : None
pyarrow          : None
pytables         : None
s3fs             : None
scipy            : None
sqlalchemy       : None
tables           : None
xarray           : None
xlrd             : None
xlwt             : None
xlsxwriter       : None

</details>



Discussion:
Probably need to include something like `not isinstance(obj, type)` in this block

```python
    128 def _isna_new(obj):
    129     if is_scalar(obj):
    130         return libmissing.checknull(obj)
    131     # hack (for now) because MI registers as ndarray
    132     elif isinstance(obj, ABCMultiIndex):
    133         raise NotImplementedError("isna is not defined for MultiIndex")
    134     elif isinstance(
    135         obj,
    136         (
    137             ABCSeries,
    138             np.ndarray,
    139             ABCIndexClass,
    140             ABCExtensionArray,
    141             ABCDatetimeArray,
    142             ABCTimedeltaArray,
    143         ),
    144     ):
--> 145         return _isna_ndarraylike(obj)
 ```

Resolving patch:
diff --git a/pandas/core/dtypes/missing.py b/pandas/core/dtypes/missing.py
--- a/pandas/core/dtypes/missing.py
+++ b/pandas/core/dtypes/missing.py
@@ -133,6 +133,8 @@ def _isna_new(obj):
     # hack (for now) because MI registers as ndarray
     elif isinstance(obj, ABCMultiIndex):
         raise NotImplementedError("isna is not defined for MultiIndex")
+    elif isinstance(obj, type):
+        return False
     elif isinstance(
         obj,
         (
@@ -171,6 +173,8 @@ def _isna_old(obj):
     # hack (for now) because MI registers as ndarray
     elif isinstance(obj, ABCMultiIndex):
         raise NotImplementedError("isna is not defined for MultiIndex")
+    elif isinstance(obj, type):
+        return False
     elif isinstance(obj, (ABCSeries, np.ndarray, ABCIndexClass)):
         return _isna_ndarraylike_old(obj)
     elif isinstance(obj, ABCGeneric):


Test patch:
diff --git a/pandas/tests/dtypes/test_missing.py b/pandas/tests/dtypes/test_missing.py
--- a/pandas/tests/dtypes/test_missing.py
+++ b/pandas/tests/dtypes/test_missing.py
@@ -86,6 +86,10 @@ def test_isna_isnull(self, isna_f):
         assert not isna_f(np.inf)
         assert not isna_f(-np.inf)
 
+        # type
+        assert not isna_f(type(pd.Series()))
+        assert not isna_f(type(pd.DataFrame()))
+
         # series
         for s in [
             tm.makeFloatSeries(),