[issue39759] os.getenv documentation is misleading

2021-07-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not so uncommon to write: foo_rate = float(os.getenv("FOO_RATE", default_foo_rate)) where default_foo_rate is float. In any case the default value for the default parameter is not a string. -- nosy: +serhiy.storchaka ___

[issue39759] os.getenv documentation is misleading

2021-07-02 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- nosy: +sir-sigurd ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue39759] os.getenv documentation is misleading

2020-02-26 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: I don't really have a preference regarding saying that `default` should be a string or not but the phrase should still be reworded to be less confusing. In typeshed it's documented with a generic type: https://github.com/python/typeshed/blob/master/stdlib/3/os/

[issue39759] os.getenv documentation is misleading

2020-02-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: I consider a free type for the default as an implementation detail, not the encouraged approach. Since the value is always a string, using the same type for the default sounds like a sane design for me. -- nosy: +asvetlov __

[issue39759] os.getenv documentation is misleading

2020-02-26 Thread Andrei Daraschenka
Change by Andrei Daraschenka : -- keywords: +patch nosy: +dorosch nosy_count: 2.0 -> 3.0 pull_requests: +18024 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18668 ___ Python tracker

[issue39759] os.getenv documentation is misleading

2020-02-26 Thread Rémi Lapeyre
New submission from Rémi Lapeyre : The documentation states that "*key*, *default* and the result are str." at https://github.com/python/cpython/blame/3.8/Doc/library/os.rst#L224 but either I'm missing something or it's not actually true: $ python -c 'import os; print(type(os.getenv("FOO")))'