for PyObject being working with std/strformat
Types
FormatPyObjectError = object of CatchableError
- inner Source Edit
Procs
proc formatValue[O: PyObject](s: var string; obj: O; specS: static[string]) {. ...raises: [FormatPyObjectError].}
- remember to wrap around handleFormatExc Source Edit
proc formatValue[O: PyObject](s: var string; obj: O; specS: string) {. ...raises: [FormatPyObjectError].}
- remember to wrap around handleFormatExc Source Edit
Templates
template `&`(fun: typedesc[PyStrFmt]; str: string{lit}): PyStrObject
-
Example:
proc f: PyObject = let msg: PyStrObject = PyStrFmt&"hello {86}" return msg discard f()
Source Edit template handleFormatExc(body)
- Source Edit
template handleFormatExc(handle, body)
- Source Edit
template newPyStrF(str: string{lit}): PyStrObject
- unstable. only used within function that returns PyObject Source Edit
template raisePyFormatExc(e: PyBaseErrorObject)
- Source Edit
template setPyFormatExc(e: PyBaseErrorObject)
- Source Edit
Exports
-
joinAsRunes, newUnicodeVariant, doKindsWith2It, asUTF8AndSize, newUnicodeVariant, newPyString, asUTF8, newPyString, newUnicodeVariant, &, newUnicodeUnicodeVariantOfCap, asUTF8AndSize, hash, newUnicodeVariant, newUnicodeVariant, $, fastCopyCharacters, newPyString, newUnicodeUnicodeVariant, toRunes, PyStrObject, kind, data, UnicodeVariant, asUTF8, ==, newPyString, isAscii, newPyString, itemSize, cmpAscii, newUnicodeUnicodeVariant, PyUnicode_READ, $, newPyStr, MAX_UNICODE, itemSize, &, newAsciiUnicodeVariant, newUnicodeUnicodeVariant, eqAscii, ==, newPyAscii, newPyStr, &, repr, len, pyStrObjectType, add, checkConsistency, ofPyStrObject, doBothKindOk, &, newPyAscii, newAsciiUnicodeVariantOfCap, newUnicodeOrAsciiUnicodeVariant, newAsciiUnicodeVariant, hash, [], ofExactPyStrObject, newPyStrSimple, len, PyObject