mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 14:50:19 +00:00
@@ -633,7 +633,7 @@ with the class approach:
|
||||
|
||||
class CustomOpen(object):
|
||||
def __init__(self, filename):
|
||||
self.file = open(filename)
|
||||
self.file = open(filename)
|
||||
|
||||
def __enter__(self):
|
||||
return self.file
|
||||
|
||||
Reference in New Issue
Block a user