Commit b8d3fdd
authored
pythongh-70647: Better promote how to safely parse yearless dates in datetime. (pythonGH-116179)
* pythongh-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 well1 parent 8d2d7bb commit b8d3fdd
1 file changed
Lines changed: 37 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2651 | 2651 | | |
2652 | 2652 | | |
2653 | 2653 | | |
2654 | | - | |
2655 | | - | |
2656 | | - | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
2657 | 2690 | | |
2658 | 2691 | | |
2659 | 2692 | | |
| |||
2790 | 2823 | | |
2791 | 2824 | | |
2792 | 2825 | | |
2793 | | - | |
| 2826 | + | |
2794 | 2827 | | |
2795 | 2828 | | |
2796 | 2829 | | |
| |||
2817 | 2850 | | |
2818 | 2851 | | |
2819 | 2852 | | |
2820 | | - | |
2821 | | - | |
| |||
0 commit comments