This file contains hidden or 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
| class StringView: | |
| """ | |
| StringView implementation using minimal copying with maximum use of | |
| reference semantics. Creating a sub-view of an existing StringView using | |
| either object slicing or constructing one from another will reüse the same | |
| source string object, using a reference rather than a copy. | |
| The contents() method can similarly be used to get an iterator (Generator) | |
| to access the view contents sequentially without putting it all in memory | |
| at once. | |
| A brand new string object is only created if the StringView is cast to str. |