MCPcopy Create free account
hub / github.com/ActiveState/code / _extendOrAppend

Method _extendOrAppend

recipes/Python/259147_FSList/recipe-259147.py:315–324  ·  view source on GitHub ↗

A kludge to ensure that the list is created correctly in __init__ This extends or appends the list, depending on whether we are adding a list or a string.

(self, data)

Source from the content-addressed store, hash-verified

313 return unwoundlist
314
315 def _extendOrAppend(self, data):
316 """
317 A kludge to ensure that the list is created correctly in __init__
318 This extends or appends the list, depending on whether we are
319 adding a list or a string.
320 """
321 if isinstance(data, StringType):
322 super(FSList, self).append(data)
323 elif isinstance(data, ListType):
324 super(FSList, self).extend(data)
325
326 def _populate(self, pattern, recursive = False, file_only = False):
327 """

Callers 1

__init__Method · 0.95

Calls 2

appendMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected