I believe this can be 

```python
if isinstance(data, (int, long)):
  ...
```