Python Forum
iPython tab completion of method variable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iPython tab completion of method variable
#1
is there any way to get iPython to recognize the type of "each" in B.printBarList().  for example I want to use tab-complete in iPython so I type "each." but it doesn't know the type.  

# A.py
class A:
    
    def __init__(self):
        self._foo = "FOO"

    def getFoo(self):
        return self._foo
# B.py
from A import A
class B:

    def createBarList(self):
        '''create 10 instances of A in barList'''
        barList = []
        for i in range(10):
            barList.append(A())
        return barList

    def printBarList(self, barList):
        '''
        Itter over each A in barList and print each
        ***MY QUESTION*** the "each" in the loop below
        '''
        for each in barList:
            print(each.foo)

if __name__ == "__main__":

    b = b()
    barList = b.createBarList()
    b.printBarList()
Moderator Larz60+: Changed icode tags to Python tags (see help, BBCODE)
Reply


Messages In This Thread
iPython tab completion of method variable - by sixteenornumber - Mar-31-2017, 12:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  IPython errors for numpy array min/max methods muelaner 1 735 Nov-04-2023, 09:22 PM
Last Post: snippsat
  Can a program execute code in iPython shell and get result? deanhystad 3 1,921 Jun-17-2022, 03:45 AM
Last Post: Larz60+
  IPython console vs Spyder script losc 3 2,919 Apr-30-2020, 04:57 AM
Last Post: deanhystad
  How can I create a multiline input in ipython? DataMower 3 4,541 Oct-28-2019, 08:50 PM
Last Post: DataMower
  creating a variable in a method and using in another method ridgerunnersjw 5 3,126 Oct-04-2019, 04:03 PM
Last Post: buran
  ipython autocomplete broke indentation! Exsul 6 4,837 Aug-20-2019, 01:29 AM
Last Post: Exsul
  Multiprocessing Module Running An Infinite Child Process Even After Completion hsikora 0 4,013 Dec-19-2018, 08:01 AM
Last Post: hsikora
  How to clear IPython console in Spyder? Vai 7 56,612 Aug-20-2018, 09:43 PM
Last Post: james_balcomb
  Stopwatch in Python/IPython shell suvadip 3 4,468 Jul-06-2018, 01:51 PM
Last Post: snippsat
  Subprocess.send_signal, wait until completion plinio 5 9,340 Jun-29-2018, 12:07 PM
Last Post: plinio

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020