On 8/4/2010 3:44 PM, Huy Ton That wrote:
Oh, that's right, I should have tried to example in the interpreter instead of in my head:P

Say Bob,

Is that the preferred method over something like:

I would prefer to create a class and make these functions class methods.

class A:
  def output_text(self, data):return data
  def output_hex(self, data):return '\\x' + data
  def __getattr__(self, name):
    return self.output_text
a = A()
data='bar'
print a.output_text(data)
print a.output_hex(data)
print a.foo(data)

--

Bob Gailer
919-636-4239
Chapel Hill NC

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to