python-phonenumbers
python-phonenumbers copied to clipboard
What does phonenumbers.number_type() return?
I searched quite long but what does 0 and 1 as return of the method number_type() mean?
Is 0 for landline and 1 for mobile?
I cannot find any documentation about the return value. Can anyone help me please?
It returns a PhoneNumberType enum, so 0 is FIXED_LINE and 1 is MOBILE.
>>> import phonenumbers
>>> help(phonenumbers.number_type)
number_type(numobj)
Gets the type of a phone number.
Arguments:
numobj -- The PhoneNumber object that we want to know the type of.
Returns the type of the phone number, as a PhoneNumberType value.
>>> help(phonenumbers.PhoneNumberType)
class PhoneNumberType(__builtin__.object)
| Type of phone numbers.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| FIXED_LINE = 0
|
| FIXED_LINE_OR_MOBILE = 2
|
| MOBILE = 1
...
I've clarified the docstring a bit.
Great. Thank you!