PEP 597 bikeshedding: envvar / option name.
I am updating PEP 597 to include discussions in the thread. Before finishing the PEP, I need to decide the option name. I used PYTHONWARNDEFAULTENCODING (envvar name) / warn_default_encoding (-X option and sys.flags name) before, but it seems too long and hard to type, easy to misspell. Currently, I use PYTHONWARNENCODING / warn_encoding, but it is not so explicit. Which name is the best balance between explicitness and readability? * PYTHONWARNENCODING / warn_ecoding * PYTHONWARNOMITENCODING / warn_omit_encoding * PYTHONWARNDEFAULTENCODING / warn_default_encoding * Anything else Regards, -- Inada Naoki <songofacandy@gmail.com>
Let the bikeshedding begin. How about with the underscores in place? More readable to my eyes. On Mon, 2021-02-15 at 14:28 +0900, Inada Naoki wrote:
I am updating PEP 597 to include discussions in the thread. Before finishing the PEP, I need to decide the option name.
I used PYTHONWARNDEFAULTENCODING (envvar name) / warn_default_encoding (-X option and sys.flags name) before, but it seems too long and hard to type, easy to misspell.
Currently, I use PYTHONWARNENCODING / warn_encoding, but it is not so explicit.
Which name is the best balance between explicitness and readability?
* PYTHONWARNENCODING / warn_ecoding * PYTHONWARNOMITENCODING / warn_omit_encoding * PYTHONWARNDEFAULTENCODING / warn_default_encoding * Anything else
Regards,
On Mon, Feb 15, 2021 at 3:00 PM Paul Bryan <pbryan@anode.ca> wrote:
Let the bikeshedding begin. How about with the underscores in place? More readable to my eyes.
I agree with you. Although it is not consistent with existing many option names, it is much more readable. Ivan, Victor, what do you think? about PYTHON_WARN_DEFAULT_ENCODING? --- Inada Naoki <songofacandy@gmail.com>
Environment variable names with underscore would be more readable, but IMO consistency with all existing names matters more: https://docs.python.org/dev/using/cmdline.html#environment-variables So I prefer PYTHONWARNDEFAULTENCODING env var and sys.flags.warn_default_encoding attribute names. Victor On Fri, Feb 19, 2021 at 9:48 AM Inada Naoki <songofacandy@gmail.com> wrote:
On Mon, Feb 15, 2021 at 3:00 PM Paul Bryan <pbryan@anode.ca> wrote:
Let the bikeshedding begin. How about with the underscores in place? More readable to my eyes.
I agree with you. Although it is not consistent with existing many option names, it is much more readable.
Ivan, Victor, what do you think? about PYTHON_WARN_DEFAULT_ENCODING?
--- Inada Naoki <songofacandy@gmail.com>
-- Night gathers, and now my watch begins. It shall not end until my death.
As long as we don't encounter sys.flags.pen_is_mightier type of cases, I guess it'll be OK. :-) On Fri, 2021-02-19 at 12:08 +0100, Victor Stinner wrote:
Environment variable names with underscore would be more readable, but IMO consistency with all existing names matters more: https://docs.python.org/dev/using/cmdline.html#environment-variables
So I prefer PYTHONWARNDEFAULTENCODING env var and sys.flags.warn_default_encoding attribute names.
Victor
On Fri, Feb 19, 2021 at 9:48 AM Inada Naoki <songofacandy@gmail.com> wrote:
On Mon, Feb 15, 2021 at 3:00 PM Paul Bryan <pbryan@anode.ca> wrote:
Let the bikeshedding begin. How about with the underscores in place? More readable to my eyes.
I agree with you. Although it is not consistent with existing many option names, it is much more readable.
Ivan, Victor, what do you think? about PYTHON_WARN_DEFAULT_ENCODING?
--- Inada Naoki <songofacandy@gmail.com>
I see plenty of envvars with similarly long names at https://docs.python.org/3/using/cmdline.html . So your initial name "PYTHONWARNDEFAULTENCODING" LGTM. The first intuitive choice is often the right one ('cuz it's, well, intuitive). On 15.02.2021 8:28, Inada Naoki wrote:
I am updating PEP 597 to include discussions in the thread. Before finishing the PEP, I need to decide the option name.
I used PYTHONWARNDEFAULTENCODING (envvar name) / warn_default_encoding (-X option and sys.flags name) before, but it seems too long and hard to type, easy to misspell.
Currently, I use PYTHONWARNENCODING / warn_encoding, but it is not so explicit.
Which name is the best balance between explicitness and readability?
* PYTHONWARNENCODING / warn_ecoding * PYTHONWARNOMITENCODING / warn_omit_encoding * PYTHONWARNDEFAULTENCODING / warn_default_encoding * Anything else
Regards,
-- Regards, Ivan
On Mon, Feb 15, 2021 at 6:31 AM Inada Naoki <songofacandy@gmail.com> wrote:
* PYTHONWARNENCODING / warn_ecoding
(I love this "ecoding" typo, but it's not my favorite choice ;-)) I dislike "warn_encoding" because it is too generic. An encoding? Which one? Why does anyone want to emit a warning when an encoding is used? Ah, only when it's not specified?
* PYTHONWARNOMITENCODING / warn_omit_encoding * PYTHONWARNDEFAULTENCODING / warn_default_encoding
IMO this name describes exactly what the PEP 597 purpose. It can be read aloud: "emit a warning when the default encoding is used". Victor -- Night gathers, and now my watch begins. It shall not end until my death.
Thank you for all. I finally submit the PEP 597 with PYTHONWARNDEFAULTENCODING / warn_default_encoding. On Mon, Feb 15, 2021 at 2:28 PM Inada Naoki <songofacandy@gmail.com> wrote:
I am updating PEP 597 to include discussions in the thread. Before finishing the PEP, I need to decide the option name.
I used PYTHONWARNDEFAULTENCODING (envvar name) / warn_default_encoding (-X option and sys.flags name) before, but it seems too long and hard to type, easy to misspell.
Currently, I use PYTHONWARNENCODING / warn_encoding, but it is not so explicit.
Which name is the best balance between explicitness and readability?
* PYTHONWARNENCODING / warn_ecoding * PYTHONWARNOMITENCODING / warn_omit_encoding * PYTHONWARNDEFAULTENCODING / warn_default_encoding * Anything else
Regards, -- Inada Naoki <songofacandy@gmail.com>
-- Inada Naoki <songofacandy@gmail.com>
participants (4)
-
Inada Naoki
-
Ivan Pozdeev
-
Paul Bryan
-
Victor Stinner