Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
py/objstr: Support '{:08}'.format("Jan") like Python 3.10.
The new test has an .exp file, because it is not compatible with Python 3.9 and lower. See CPython version of the issue at https://bugs.python.org/issue27772 Signed-off-by: Jeff Epler <jepler@gmail.com>
- Loading branch information
Showing
4 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Python 3.10+ functionality test for {} format string | ||
|
||
def test(fmt, *args): | ||
print('{:8s}'.format(fmt) + '>' + fmt.format(*args) + '<') | ||
|
||
test("{:0s}", "ab") | ||
test("{:06s}", "ab") | ||
test("{:<06s}", "ab") | ||
test("{:>06s}", "ab") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{:0s} >ab< | ||
{:06s} >ab0000< | ||
{:<06s} >ab0000< | ||
{:>06s} >0000ab< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters