Skip to main content

String-like Objects

Project description

The :py:mod:`protostrings` distribution provides string-like objects with functional aspects, integrating well with the standard string type. Each :py:mod:`protostring` simply wraps a function dictating specific behaviours within the overarching constraints of the type. Due to their dynamic nature, features such as length or indexing are not supported. Memoizing variants of each :py:mod:`protostring` type are provided. The :py:mod:`inspect` module is required only for visualing :py:mod:`protostrings` (:py:meth:`~.LazyString.__str__`, :py:meth:`~.LazyString.__repr__`, :py:meth:`~.LazyString.pprint`), and is thus a soft requirement.

>>> protostring = "alpha " + ((lazy_str + context_str_right) + context_str_both) + " omega"
>>> protostring.pprint(False)
LazyString (...)
LazyString (...)
str 'alpha '
LazyString (...)
ContextString (...)
LazyString ()
ContextString (...)
ContextString (...)
str ' omega'
>>> str(protostring)
'alpha @@everything else@@ omega'
>>> "...alpha " + (context_str_right + context_str_both) + " omega..."
'...alpha (everything else) omega...'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

protostrings-1.0.0.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

protostrings-1.0.0.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file protostrings-1.0.0.0.tar.gz.

File metadata

File hashes

Hashes for protostrings-1.0.0.0.tar.gz
Algorithm Hash digest
SHA256 26c5929ca0c1fad2e5b837b6f46f034625ac2d6a98eb9c59c0276570f2db573c
MD5 4b02395bdc759aa407d1987a32945d24
BLAKE2b-256 665d4f01aa7284b191161cb6086547de4b7966a4eb11a0544e63cc5e82b5db15

See more details on using hashes here.

File details

Details for the file protostrings-1.0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for protostrings-1.0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5131999043cc1cf2b51932f5384000474775d053898380c6f9ae291a816dbc4
MD5 7795e5e4f0b205ee88d926a792897147
BLAKE2b-256 94f3e2aa65e2b48a44060a78279e5ad76d776287ee7d7f22adaf82ffcf884d99

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page