MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / MyList

Class MyList

arrays/PythonLists.py:16–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14print(aSlice) # [3, 4]
15
16class MyList(list): # Inherit from list
17 # Define a method; 'this' pointer is explicit:
18 def getReversed(self):
19 reversed = self[:] # Copy list using slices
20 reversed.reverse() # Built-in list method
21 return reversed
22
23# No 'new' necessary for object creation: {#24-no-new-necessary-for-object-creation}
24list2 = MyList(aList)

Callers 1

PythonLists.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected