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
b6d78fcd
Commit
b6d78fcd
authored
Jul 07, 2000
by
Marc-André Lemburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests for new instance support in unicode().
parent
3d476d73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
Lib/test/test_unicode.py
Lib/test/test_unicode.py
+15
-0
No files found.
Lib/test/test_unicode.py
View file @
b6d78fcd
...
...
@@ -298,6 +298,21 @@ assert unicode('hello','utf-8') == u'hello'
assert
unicode
(
'hello'
,
'utf8'
)
==
u'hello'
assert
unicode
(
'hello'
,
'latin-1'
)
==
u'hello'
class
String
:
x
=
''
def
__str__
(
self
):
return
self
.
x
o
=
String
()
o
.
x
=
'abc'
assert
unicode
(
o
)
==
u'abc'
assert
str
(
o
)
==
'abc'
o
.
x
=
u'abc'
assert
unicode
(
o
)
==
u'abc'
assert
str
(
o
)
==
'abc'
try
:
u'Andr
\
202
x'
.
encode
(
'ascii'
)
u'Andr
\
202
x'
.
encode
(
'ascii'
,
'strict'
)
...
...
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