On 4/24/07, "Guido van Rossum" <[EMAIL PROTECTED]> wrote:
>
>
>
> But Python doesn't have protected, and isn't about to get it.
>

We use methods names with one underscore as a convention for protected
methods and I think we learned that from somebody else:

class Eggs:

  def thePublicMethod(self):
      things = self._myProtected()
      return [ "thing_%s" % str(thing) for thing in things]

  def _myProtected(self):
      raise RuntimeError("missing base method")

class RealEggs(AbstractEggs):
  def _myProtected(self):
      return ["one", "two"]


-- 
Luis P Caamano
Atlanta, GA USA
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to