are you using it to calculate a value in a new field? or are you using it within a field calculator expression? And it may actually be returning something but not what you expect. It is often more useful to use isinstance

a = 5

>>> isinstance(a,(int, float, complex))

True

You can then use it to its full advantage to control what goes into the field based upon its type/class. For example to make an entry a string, you can check for its type, then do one thing and if it is something else, do another thing. So to use the field entry (a =5) lets, make it a string if it is a number otherwise do something else

["string already", str(a)][ isinstance(a, (int,float,complex))]

This just uses boolean slicing with the left side representing [do this if false, do this if true]

and the right side returning a boolean ... [ isinstance check ] since True and False equate to 1 and 0

Thanks Dan, I appreciate the detailed response. I did find isinstance and started playing with it. What I'm really after is flagging non-integer values in a field. I'm parsing out house numbers from an address string and I want to flag any value that is not an integer for further review. Due to the nature of the data it's stored in a string field.

def gettype(LPart):
return isinstance(LPart,int)
gettype( !LeftPart!)

Calling the above function to populate the LType field gives the results shown above, but I would expect the last 3 rows to return 1 since they are integers. Is is returning false because the data is coming from a string field? Also, I see you are passing more arguments than just "int", I can't find any documentation on the classinfo argument, can you elaborate on that?

Not sure what happened to the missing post but I did see all of the text via email notifications. Thanks Dan Patterson and Freddie Gibson for explaining the functions and finding a solution to my problem.

This part by Freddie covered the initial problem. After some more thinking over the weekend I had a small suspicion that this might be the case (not returning int because the data is stored as a string). Thanks for confirming.

Looking at your screenshot I'd assume your LeftPart field is a Text field because it allows you to store values other than numbers and decimals. As a result, even if the value in the field were '1234' the type would always return string because the values are stored as strings and not a numeric type (e.g. int, float, double).