MCPcopy Create free account
hub / github.com/Lauriat/funct / headOption

Method headOption

funct/Array.py:886–891  ·  view source on GitHub ↗

Selects the first element of this Array if it has one, otherwise returns default.

(self, default=None)

Source from the content-addressed store, hash-verified

884 return self[0]
885
886 def headOption(self, default=None):
887 """
888 Selects the first element of this Array if it has one,
889 otherwise returns default.
890 """
891 return self.get(0, default)
892
893 @property
894 def last(self):

Callers 2

squeezeMethod · 0.95
testMethod · 0.95

Calls 1

getMethod · 0.95

Tested by 1

testMethod · 0.76