Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document phone number extension handling #583

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

francoisfreitag
Copy link
Collaborator

@francoisfreitag francoisfreitag commented Nov 15, 2023

Closes #581

@francoisfreitag
Copy link
Collaborator Author

@stefanfoulis do you remember why E.164 is the default over E.123 (INTERNATIONAL)?

@stefanfoulis
Copy link
Owner

@stefanfoulis do you remember why E.164 is the default over E.123 (INTERNATIONAL)?
I don't know. :-/

@francoisfreitag
Copy link
Collaborator Author

I see. It might be a good idea to transition to the INTERNATIONAL format by default. I’ll start the deprecation in the upcoming weeks, unless someone is concerned with changing the default?

@francoisfreitag
Copy link
Collaborator Author

I started looking at changing the default. I don’t think it’s worth the hassle. I assume most projects don’t use extensions, and the INTERNATIONAL representation is slightly different:

>>> str(phonenumbers.format_number(x, phonenumbers.PhoneNumberFormat.INTERNATIONAL))
'+44 20 8366 1177'
>>> str(phonenumbers.format_number(x, phonenumbers.PhoneNumberFormat.E164))
'+442083661177'

The added spaces are sure to break code for someone, who doesn’t care about extensions at all. Unless there’s strong support for changing the default, it’ll stay as E164.

@francoisfreitag francoisfreitag merged commit cdb3818 into stefanfoulis:main Dec 14, 2023
50 checks passed
@francoisfreitag francoisfreitag deleted the docfmt branch December 14, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extension information is lost during serialization
2 participants