Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
43b5a857
Commit
43b5a857
authored
Dec 05, 2010
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Describe the transform/untranform methods
parent
dadf93c9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
Doc/whatsnew/3.2.rst
Doc/whatsnew/3.2.rst
+19
-0
No files found.
Doc/whatsnew/3.2.rst
View file @
43b5a857
...
...
@@ -298,6 +298,25 @@ Other Language Changes
Some smaller changes made to the core Python language are:
* :class:`bytes` and :class:`str` now have two net methods, *tranform* and *untransform*.
These provided analogues to *encode* and *decode* but are used for general purpose
string-to-string and bytes-to-bytes transformations rather than Unicode codecs.
Along with the new methods, several non-unicode codecs been restored from Python 2.x
including *base64*, *bz2*, *hex*, *quopri*, *rot13*, *uu*, and *zlib*.
>>> t = b'which witch had which witches wrist watch'
>>> t.transform('quopri')
b'which=20witch=20had=20which=20witches=20wrist=20watch'
>>> short = t.transform('zlib_codec')
>>> len(t), len(short)
(41, 38)
>>> short.untransform('zlib_codec')
b'which witch had which witches wrist watch'
(From multiple contributers in :issue:`7475`.)
* The interpreter can now be started with a quiet option, ``-q``, to suppress
the copyright and version information in an interactive mode.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment