isinstance()
In your case, isinstance("this is a string", str)
will return True
.
You may also want to read this: http://www.canonical.org/~kragen/isinstance/
More Related Contents:
- Determine the type of an object?
- Change column type in pandas
- Immutable vs Mutable types
- How to check if string input is a number?
- Store different datatypes in one NumPy array?
- Can pandas automatically read dates from a CSV file?
- List vs tuple, when to use each? [duplicate]
- How do I find numeric columns in Pandas?
- What is the best (idiomatic) way to check the type of a Python variable? [duplicate]
- Fastest way to convert a dict’s keys & values from `unicode` to `str`?
- Check if all elements of a list are of the same type
- Complex numbers in python
- Python sum, why not strings? [closed]
- How to compare a list of lists/sets in python?
- How to keep leading zeros in a column when reading CSV with Pandas?
- How can I check if my python object is a number? [duplicate]
- What does dtype=object mean while creating a numpy array?
- Python check for integer input
- How to find out if a Python object is a string?
- Why does object.__new__ work differently in these three cases
- Type hinting in Python 2
- How to check if a variable is a function in Python?
- the bytes type in python 2.7 and PEP-358
- How do you set a conditional in python based on datatypes?
- Python: Can a subclass of float take extra arguments in its constructor?
- Possible to enforce type hints?
- Identifying the data type of an input
- Do union types actually exist in python?
- Can i set float128 as the standard float-array in numpy
- Comparing 2 lists consisting of dictionaries with unique keys in python