mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
* Mass change: get rid of all init() methods, in favor of __init__()
constructors. There is no backward compatibility. Not everything has been tested. * aiff.{py,doc}: deleted in favor of aifc.py (which contains its docs as comments)
This commit is contained in:
parent
aa14837bd0
commit
7bc817d5ba
42 changed files with 153 additions and 207 deletions
|
@ -10,8 +10,8 @@
|
|||
# fp = open(file, 'r')
|
||||
# (or use any other legal way of getting an open file object, e.g. use
|
||||
# sys.stdin or call os.popen()).
|
||||
# Then pass the open file object to the init() method of Message:
|
||||
# m = Message().init(fp)
|
||||
# Then pass the open file object to the Message() constructor:
|
||||
# m = Message(fp)
|
||||
#
|
||||
# To get the text of a particular header there are several methods:
|
||||
# str = m.getheader(name)
|
||||
|
@ -35,7 +35,7 @@ class Message:
|
|||
|
||||
# Initialize the class instance and read the headers.
|
||||
|
||||
def init(self, fp):
|
||||
def __init__(self, fp):
|
||||
self.fp = fp
|
||||
#
|
||||
try:
|
||||
|
@ -49,8 +49,6 @@ class Message:
|
|||
self.startofbody = self.fp.tell()
|
||||
except IOError:
|
||||
self.startofbody = None
|
||||
#
|
||||
return self
|
||||
|
||||
|
||||
# Rewind the file to the start of the body (if seekable).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue