5 examples of 'python list extend' in Python

Every line of 'python list extend' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
379def extend(self, values):
380 """Append all values to the end.
381
382 If any of the values are present, ValueError will
383 be raised and none of the values will be appended.
384
385 Args:
386 values (Iterable): Values to append
387 Raises:
388 ValueError: If any values are already present or there are duplicates
389 in the passed values.
390 TypeError: If any of the values aren't hashable.
391 """
392 self._extend(values)
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

341def append_or_extend_list(lst, value):
342 if value is None:
343 return
344 elif isinstance(value, list):
345 lst.extend(value)
346 else:
347 lst.append(value)
48def extend(self, space, w_other):
49 self._items_w.extend(space.listview(w_other))
981def LIST_APPEND(f, *ignored):
982 w = f.popvalue()
983 v = f.popvalue()
984 f.space.call_method(v, 'append', w)
368def append(self, value):
369 """Append value to the end.
370
371 Args:
372 value: Value to append
373 Raises:
374 ValueError: If value alread in self
375 TypeError: If value isn't hashable
376 """
377 self._append(value)

Related snippets