Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

__slots__ python example

class GFG(object):
      __slots__=['a', 'b']
      def __init__(self, *args, **kwargs):
                self.a = 1
                self.b = 2
  
if __name__ == "__main__":
     instance = GFG()
     print(instance.__slots__)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #python
ADD COMMENT
Topic
Name
3+7 =