
class cscRoot (object):
    """This little bundle of joy exists because in Python 2.6 it
    became an error to invoke object.__init__ with parameters (unless
    you also override __new__, in which case it's only a warning.
    Whatever.).  Since I'm bloody not going to check in every class
    whether super(Myclass,self) refers to object (even if I could
    figure out how to do that, 'cuz the obvious solutions don't work),
    we'll just make this thing the root of all cooperative super
    calling hierarchies."""
    def __init__ (self, *args, **kw):
        pass

    #def __new__ (cls, *args, **kw):
    #    return object.__new__(cls)

from exceptions_ import *


class cscRoot (object):
    """This little bundle of joy exists because in Python 2.6 it
    became an error to invoke object.__init__ with parameters (unless
    you also override __new__, in which case it's only a warning.
    Whatever.).  Since I'm bloody not going to check in every class
    whether super(Myclass,self) refers to object (even if I could
    figure out how to do that, 'cuz the obvious solutions don't work),
    we'll just make this thing the root of all cooperative super
    calling hierarchies."""
    def __init__ (self, *args, **kw):
        # Oh gross.  If this class descends from unicode or string, we
        # get here when object is *not* our direct superclass.  In
        # that case, we have to pass the arguments on up, or the
        # strings don't get created right.  Below is the only way I've
        # figured out to detect the situation.
        if self.__class__ != self.__class__.mro()[-1]:
            super(cscRoot, self).__init__(*args, **kw)

from exceptions_ import *

Handle unicode and string creation correctly
Handle unicode and string creation correctly

  
  class cscRoot (object):
      """This little bundle of joy exists because in Python 2.6 it
      became an error to invoke object.__init__ with parameters (unless
      you also override __new__, in which case it's only a warning.
      Whatever.).  Since I'm bloody not going to check in every class
      whether super(Myclass,self) refers to object (even if I could
      figure out how to do that, 'cuz the obvious solutions don't work),
      we'll just make this thing the root of all cooperative super
      calling hierarchies."""
      def __init__ (self, *args, **kw):
-         pass
- 
-     #def __new__ (cls, *args, **kw):
-     #    return object.__new__(cls)
+         # Oh gross.  If this class descends from unicode or string, we
+         # get here when object is *not* our direct superclass.  In
+         # that case, we have to pass the arguments on up, or the
+         # strings don't get created right.  Below is the only way I've
+         # figured out to detect the situation.
+         if self.__class__ != self.__class__.mro()[-1]:
+             super(cscRoot, self).__init__(*args, **kw)
  
  from exceptions_ import *
  
Handle unicode and string creation correctly
## Code Before:

class cscRoot (object):
    """This little bundle of joy exists because in Python 2.6 it
    became an error to invoke object.__init__ with parameters (unless
    you also override __new__, in which case it's only a warning.
    Whatever.).  Since I'm bloody not going to check in every class
    whether super(Myclass,self) refers to object (even if I could
    figure out how to do that, 'cuz the obvious solutions don't work),
    we'll just make this thing the root of all cooperative super
    calling hierarchies."""
    def __init__ (self, *args, **kw):
        pass

    #def __new__ (cls, *args, **kw):
    #    return object.__new__(cls)

from exceptions_ import *

## Instruction:
Handle unicode and string creation correctly
## Code After:

class cscRoot (object):
    """This little bundle of joy exists because in Python 2.6 it
    became an error to invoke object.__init__ with parameters (unless
    you also override __new__, in which case it's only a warning.
    Whatever.).  Since I'm bloody not going to check in every class
    whether super(Myclass,self) refers to object (even if I could
    figure out how to do that, 'cuz the obvious solutions don't work),
    we'll just make this thing the root of all cooperative super
    calling hierarchies."""
    def __init__ (self, *args, **kw):
        # Oh gross.  If this class descends from unicode or string, we
        # get here when object is *not* our direct superclass.  In
        # that case, we have to pass the arguments on up, or the
        # strings don't get created right.  Below is the only way I've
        # figured out to detect the situation.
        if self.__class__ != self.__class__.mro()[-1]:
            super(cscRoot, self).__init__(*args, **kw)

from exceptions_ import *
