Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  simple_copy.py

  Sprache: Python
 

# Copyright 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""A clone of the default copy.deepcopy that doesn't handle cyclic
structures or complex types except for dicts and lists. This is
because gyp copies so large structure that small copy overhead ends up
taking seconds in a project the size of Chromium."""

class Error(Exception):
  pass

__all__ = ["Error""deepcopy"]

def deepcopy(x):
  """Deep copy operation on gyp objects such as strings, ints, dicts
  and lists. More than twice as fast as copy.deepcopy but much less
  generic."""

  try:
    return _deepcopy_dispatch[type(x)](x)
  except KeyError:
    raise Error('Unsupported type %s for deepcopy. Use copy.deepcopy ' +
                'or expand simple_copy support.' % type(x))

_deepcopy_dispatch = d = {}

def _deepcopy_atomic(x):
  return x

try:
  _string_types = (str, unicode)
# There's no unicode in python3
except NameError:
  _string_types = (str, )

try:
  _integer_types = (int, long)
# There's no long in python3
except NameError:
  _integer_types = (int, )

for x in (type(None), float, bool, type) + _integer_types + _string_types:
  d[x] = _deepcopy_atomic

def _deepcopy_list(x):
  return [deepcopy(a) for a in x]
d[list] = _deepcopy_list

def _deepcopy_dict(x):
  y = {}
  for key, value in x.items():
    y[deepcopy(key)] = deepcopy(value)
  return y
d[dict] = _deepcopy_dict

del d

Messung V0.5 in Prozent
C=83 H=94 G=88

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-05) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik