GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||
GeezerVison is showing github.com — gh-67795: Accept any real numbers as timestamp and timeout by serhiy-storchaka · Pull Request #139224 · python/cpython Conversation
|
|
Nice, it works as expected: $ ./python >>> import socket, fractions, decimal >>> socket.setdefaulttimeout(fractions.Fraction(1, 5)) >>> socket.getdefaulttimeout() 0.2 >>> socket.setdefaulttimeout(decimal.Decimal('1.5')) >>> socket.getdefaulttimeout() 1.5 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM. You may just mention Decimal and Fraction in the global NEWS entry.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| * Functions that take timestamp or timeout arguments now accept any | ||
| real numbers, not only integers or floats, although this does not | ||
| improve precision. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You may give Decimal and Fraction as examples.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.