Commit 362d11e
gh-70647: Better promote how to safely parse yearless dates in datetime. (GH-116179)
* gh-70647: Better promote how to safely parse yearless dates in datetime.
Every four years people encounter this because it just isn't obvious.
This moves the footnote up to a note with a code example.
We'd love to change the default year value for datetime but doing
that could have other consequences for existing code. This documented
workaround *always* works.
* doctest code within note is bad, dedent.
* Update to match the error message.
* remove no longer referenced footnote
* ignore the warning in the doctest
* use Petr's suggestion for the docs to hide the warning processing
* cover date.strptime (3.14) as well
(cherry picked from commit b8d3fdd)
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
1 parent 27648a1 commit 362d11e
1 file changed
+37
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2634 | 2634 | | |
2635 | 2635 | | |
2636 | 2636 | | |
2637 | | - | |
2638 | | - | |
2639 | | - | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
2640 | 2673 | | |
2641 | 2674 | | |
2642 | 2675 | | |
| |||
2767 | 2800 | | |
2768 | 2801 | | |
2769 | 2802 | | |
2770 | | - | |
| 2803 | + | |
2771 | 2804 | | |
2772 | 2805 | | |
2773 | 2806 | | |
| |||
2794 | 2827 | | |
2795 | 2828 | | |
2796 | 2829 | | |
2797 | | - | |
2798 | | - | |
| |||
0 commit comments