Commits

Ronald Oussoren  committed cbc6b60

Check if self is None after calling the superclass initializer

  • Participants
  • Parent commits d09a9e4
  • Branches pyobjc-ancient

Comments (0)

Files changed (2)

File Doc/intro.html

         """
         # ALWAYS call the super's designated initializer.
         # Also, make sure to re-bind "self" just in case it
-        # returns something else!
+        # returns something else, or even None!
         self = super(MyClass, self).init()
+        if self is None: return None
 
         self.myVariable = 10
 
         Designated initializer for MyOtherClass
         """
         self = super(MyOtherClass, self).init()
+        if self is None: return None
+
         self.otherVariable = otherVariable
         return self
 

File Doc/intro.txt

             """
             # ALWAYS call the super's designated initializer.
             # Also, make sure to re-bind "self" just in case it
-            # returns something else!
+            # returns something else, or even None!
             self = super(MyClass, self).init()
+	    if self is None: return None
 
             self.myVariable = 10
 
             Designated initializer for MyOtherClass
             """
             self = super(MyOtherClass, self).init()
+	    if self is None: return None
+
             self.otherVariable = otherVariable
             return self