"marshal" --- Internal Python object serialization
**************************************************

======================================================================

This module contains functions that can read and write Python values
in a binary format.  The format is specific to Python, but independent
of machine architecture issues (e.g., you can write a Python value to
a file on a PC, transport the file to a Mac, and read it back there).
Details of the format are undocumented on purpose; it may change
between Python versions (although it rarely does). [1]

이것은 범용 "지속성" 모듈이 아닙니다. 범용 지속성과 RPC 호출을 통한 파
이썬 객체의 전송에 대해서는, "pickle"과 "shelve" 모듈을 참조하십시오.
"marshal" 모듈은 주로 ".pyc" 파일의 파이썬 모듈에 대한 "의사 컴파일된"
코드 읽기와 쓰기를 지원하기 위해 존재합니다. 따라서, 파이썬 관리자는
필요에 따라 이전 버전과 호환되지 않는 방식으로 마샬 형식을 수정할 수
있는 권한을 갖습니다. 파이썬 객체를 직렬화하고 역 직렬화하는 데는, 대
신 "pickle" 모듈을 사용하십시오 -- 성능은 비슷하고, 버전 독립성이 보장
되며, pickle은 marshal보다 훨씬 넓은 범위의 객체를 지원합니다.

경고:

  "marshal" 모듈은 잘못되었거나 악의적으로 구성된 데이터에 대해 보안성
  을 갖추려는 것이 아닙니다. 신뢰할 수 없거나 인증되지 않은 출처에서
  받은 데이터를 역 마샬 하지 마십시오.

Not all Python object types are supported; in general, only objects
whose value is independent from a particular invocation of Python can
be written and read by this module.  The following types are
supported: booleans, integers, floating-point numbers, complex
numbers, strings, bytes, bytearrays, tuples, lists, sets, frozensets,
dictionaries, and code objects, where it should be understood that
tuples, lists, sets, frozensets and dictionaries are only supported as
long as the values contained therein are themselves supported.  The
singletons "None", "Ellipsis" and "StopIteration" can also be
marshalled and unmarshalled. For format *version* lower than 3,
recursive lists, sets and dictionaries cannot be written (see below).

파일을 읽고 쓰는 함수는 물론 바이트열류 객체에서 작동하는 함수도 있습
니다.

모듈은 다음 함수를 정의합니다:

marshal.dump(value, file[, version])

   열린 파일에 값을 기록합니다. value는 지원되는 형이어야 합니다. 파일
   은 쓰기 가능한 *바이너리 파일* 이어야 합니다.

   value가 지원되지 않는 형이면 (또는 지원되지 않는 형의 객체를 담고
   있다면) "ValueError" 예외가 발생합니다 --- 하지만, 찌꺼기 데이터도
   파일에 기록됩니다. "load()"로 객체를 제대로 읽을 수 없습니다.

   *version* 인자는 "dump"가 사용해야 하는 데이터 형식을 나타냅니다 (
   아래를 참조하십시오).

   Raises an auditing event "marshal.dumps" with arguments "value",
   "version".

marshal.load(file)

   열린 파일에서 하나의 값을 읽고 그것을 반환합니다. 유효한 값을 읽히
   지 않으면 (예를 들어, 데이터가 다른 파이썬 버전의 호환되지 않는 마
   샬 형식이라서) "EOFError", "ValueError" 또는 "TypeError"를 발생시킵
   니다. 파일은 읽을 수 있는 *바이너리 파일* 이어야 합니다.

   Raises an auditing event "marshal.load" with no arguments.

   참고:

     지원하지 않는 형을 포함하는 객체가 "dump()"로 마샬 되었으면,
     "load()"는 역 마샬이 불가능한 형을 "None"으로 치환합니다.

   버전 3.10에서 변경: This call used to raise a "code.__new__" audit
   event for each code object. Now it raises a single "marshal.load"
   event for the entire load operation.

marshal.dumps(value[, version])

   "dump(value, file)"에 의해 파일에 기록될 바이트열 객체를 반환합니다
   . value는 지원되는 형이어야 합니다. value가 지원되지 않는 형이면 (
   또는 지원되지 않는 형의 객체를 담고 있다면) "ValueError" 예외를 발
   생시킵니다.

   *version* 인자는 "dumps"가 사용해야 하는 데이터 형식을 나타냅니다 (
   아래를 참조하십시오).

   Raises an auditing event "marshal.dumps" with arguments "value",
   "version".

marshal.loads(bytes)

   *바이트열류 객체*를 값으로 변환합니다. 유효한 값이 없으면
   "EOFError", "ValueError" 또는 "TypeError"를 발생시킵니다. 입력의 여
   분의 바이트는 무시됩니다.

   Raises an auditing event "marshal.loads" with argument "bytes".

   버전 3.10에서 변경: This call used to raise a "code.__new__" audit
   event for each code object. Now it raises a single "marshal.loads"
   event for the entire load operation.

또한, 다음 상수가 정의됩니다:

marshal.version

   Indicates the format that the module uses. Version 0 is the
   historical format, version 1 shares interned strings and version 2
   uses a binary format for floating-point numbers. Version 3 adds
   support for object instancing and recursion. The current version is
   4.

-[ 각주 ]-

[1] 이 모듈의 이름은 (다른 것 중에서도) Modula-3의 설계자가 사용하는
    약간의 용어에서 유래합니다. 이들은 자급적(self-contained) 형식으로
    데이터를 전달하는 데 "마샬링(marshalling)"이라는 용어를 사용합니다
    . 엄밀히 말하면, "마샬"은 내부의 어떤 데이터를 외부 형식(예를 들어
    RPC 버퍼에)으로 변환하는 것을, "역 마샬"은 그 반대 절차를 뜻합니다
    .
