简体   繁体   中英

Assigning variable in python

I have a list of objects called deckList in my constructor. The list will hold objects of the type Deck .

self.deckList = [Deck()]

If I get the last element in the list by,

deck = self.deckList[len(self.deckList) - 1]

Why is it that if I do, deck. I will still get methods for a List object? Would I not get methods for the object type Deck ?

Any tips?

What methods you get depends on the auto complete, which your IDE is using. It might be broken or buggy... In any case, this has nothing to do with python.

Indeed it is an IDE issue. Could be pyDev that I'm running on Eclipse.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM