mirror of
https://github.com/kennethreitz-archive/parse.git
synced 2026-06-05 07:26:12 +00:00
tweaks
This commit is contained in:
+5
-2
@@ -55,7 +55,7 @@ where a more complex format specification might have been used.
|
||||
|
||||
Most of the `Format Specification Mini-Language`_ is supported::
|
||||
|
||||
[[fill]align][sign][0][width][type]
|
||||
[[fill]align][0][width][type]
|
||||
|
||||
The align operators will cause spaces (or specified fill character)
|
||||
to be stripped from the value. Similarly width is not enforced; it
|
||||
@@ -64,7 +64,8 @@ just indicates there may be whitespace or "0"s to strip.
|
||||
The "#" format character is handled automatically by d, b, o and x -
|
||||
that is: if there is a "0b", "0o" or "0x" prefix respectively, it's
|
||||
handled. For "d" any will be accepted, but for the others the correct
|
||||
prefix must be present if at all.
|
||||
prefix must be present if at all. Similarly number sign is handled
|
||||
automatically.
|
||||
|
||||
The types supported are a slightly different mix to the format() types.
|
||||
Some format() types come directly over: d, n, %, f, e, b, o and x.
|
||||
@@ -176,6 +177,8 @@ spans
|
||||
|
||||
**Version history (in brief)**:
|
||||
|
||||
- 1.1.9 to keep things simpler number sign is handled automatically;
|
||||
significant robustification in the face of edge-case input.
|
||||
- 1.1.8 allow "d" fields to have number base "0x" etc. prefixes;
|
||||
fix up some field type interactions after stress-testing the parser;
|
||||
implement "%" type.
|
||||
|
||||
@@ -68,7 +68,8 @@ just indicates there may be whitespace or "0"s to strip.
|
||||
The "#" format character is handled automatically by d, b, o and x -
|
||||
that is: if there is a "0b", "0o" or "0x" prefix respectively, it's
|
||||
handled. For "d" any will be accepted, but for the others the correct
|
||||
prefix must be present if at all.
|
||||
prefix must be present if at all. Similarly number sign is handled
|
||||
automatically.
|
||||
|
||||
The types supported are a slightly different mix to the format() types.
|
||||
Some format() types come directly over: d, n, %, f, e, b, o and x.
|
||||
@@ -181,7 +182,7 @@ spans
|
||||
**Version history (in brief)**:
|
||||
|
||||
- 1.1.9 to keep things simpler number sign is handled automatically;
|
||||
more parsing edge-cases handled.
|
||||
significant robustification in the face of edge-case input.
|
||||
- 1.1.8 allow "d" fields to have number base "0x" etc. prefixes;
|
||||
fix up some field type interactions after stress-testing the parser;
|
||||
implement "%" type.
|
||||
@@ -1119,10 +1120,10 @@ class TestParse(unittest.TestCase):
|
||||
self.assertRaises(TooManyFields, compile, '{:ti}' * 20)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
|
||||
# Copyright (c) 2011 eKit.com Inc (http://www.ekit.com/)
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
||||
Reference in New Issue
Block a user