0

I'm having trouble appending to an existing function.

def functionA(self):
  var1 = hi
  var2 = bye

Class A(object):
  def functionB(self)
    var1 = hi  <-- insert functionA here
    var2 = bye
    var3 = "something not in functionA"

Sorry I know this is probably basic, but I can't find this anywhere. The closest I've found is here Python add to a function dynamically . Thanks in advance for your help!

Community
  • 1
  • 1
mrmo123
  • 725
  • 1
  • 8
  • 23

1 Answers1

3
def functionA():
    var1 = hi
    var2 = bye
    return (var1, var2)


class A(object):
    def functionB(self):
        var1, var2 = functionA()
        var3 = "something not in functionA"

how about that?

jeyraof
  • 863
  • 9
  • 28