Skip to content

Commit 65e01b2

Browse files
committed
Clarify need for country in parsing non-E164 numbers
1 parent 966a707 commit 65e01b2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ Example Usage
1212
-------------
1313

1414
The main object that the library deals with is a `PhoneNumber` object. You can create this from a string
15-
representing a phone number using the `parse` function, but you normally also need to specify the country
16-
that the phone number is from (unless the number is in E.164 format).
15+
representing a phone number using the `parse` function, but you also need to specify the country
16+
that the phone number is being dialled from (unless the number is in E.164 format, which is globally
17+
unique).
1718

1819
```pycon
1920
>>> import phonenumbers
@@ -27,6 +28,9 @@ Country Code: 44 National Number: 2083661177 Leading Zero: False
2728
Country Code: 44 National Number: 2083661177 Leading Zero: False
2829
>>> x == y
2930
True
31+
>>> z = phonenumbers.parse("00 1 650 253 2222", "GB") # as dialled from GB, not a GB number
32+
>>> print z
33+
Country Code: 1 National Number: 6502532222 Leading Zero(s): False
3034
```
3135

3236
The `PhoneNumber` object that `parse` produces typically still needs to be validated, to check whether

0 commit comments

Comments
 (0)