We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a544c1 commit e30305eCopy full SHA for e30305e
item_03.py
@@ -3,13 +3,11 @@
3
'''Item 3 from Effective Python'''
4
5
import logging
6
-from pprint import pprint
7
-from sys import stdout as STDOUT
8
9
10
# Example 1
11
def to_str(bytes_or_str):
12
- '''In Python 3, you’ll need one method that takes a str or bytes and
+ '''In Python 3, you'll need one method that takes a str or bytes and
13
always returns a str .'''
14
if isinstance(bytes_or_str, bytes):
15
value = bytes_or_str.decode('utf-8')
@@ -23,7 +21,7 @@ def to_str(bytes_or_str):
23
21
24
22
# Example 2
25
def to_bytes(bytes_or_str):
26
- '''You’ll need another method that takes a str or bytes and always
+ '''You'll need another method that takes a str or bytes and always
27
returns a bytes .'''
28
if isinstance(bytes_or_str, str):
29
value = bytes_or_str.encode('utf-8')
0 commit comments