-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathpickle.po
More file actions
2272 lines (2021 loc) · 102 KB
/
Copy pathpickle.po
File metadata and controls
2272 lines (2021 loc) · 102 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# python-doc bot, 2025
# Takanori Suzuki <takanori@takanory.net>, 2026
# Masahiro Ito, 2026
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-08-01 14:54+0000\n"
"PO-Revision-Date: 2025-09-16 00:01+0000\n"
"Last-Translator: Masahiro Ito, 2026\n"
"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/"
"ja/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ja\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/pickle.rst:2
msgid ":mod:`!pickle` --- Python object serialization"
msgstr ":mod:`!pickle` --- Python オブジェクトの直列化"
#: ../../library/pickle.rst:7
msgid "**Source code:** :source:`Lib/pickle.py`"
msgstr "**ソースコード:** :source:`Lib/pickle.py`"
#: ../../library/pickle.rst:19
msgid ""
"The :mod:`!pickle` module implements binary protocols for serializing and de-"
"serializing a Python object structure. *\"Pickling\"* is the process "
"whereby a Python object hierarchy is converted into a byte stream, and "
"*\"unpickling\"* is the inverse operation, whereby a byte stream (from a :"
"term:`binary file` or :term:`bytes-like object`) is converted back into an "
"object hierarchy. Pickling (and unpickling) is alternatively known as "
"\"serialization\", \"marshalling,\" [#]_ or \"flattening\"; however, to "
"avoid confusion, the terms used here are \"pickling\" and \"unpickling\"."
msgstr ""
#: ../../library/pickle.rst:30
msgid "The ``pickle`` module **is not secure**. Only unpickle data you trust."
msgstr ""
"``pickle`` モジュールは **安全ではありません** 。信頼できるデータのみを非 "
"pickle 化してください。"
#: ../../library/pickle.rst:32
msgid ""
"It is possible to construct malicious pickle data which will **execute "
"arbitrary code during unpickling**. Never unpickle data that could have come "
"from an untrusted source, or that could have been tampered with."
msgstr ""
"**非 pickle 化の過程で任意のコードを実行する** ような、悪意ある pickle オブ"
"ジェクトを生成することが可能です。信頼できない提供元からのデータや、改竄され"
"た可能性のあるデータの非 pickle 化は絶対に行わないでください。"
#: ../../library/pickle.rst:36
msgid ""
"Consider signing data with :mod:`hmac` if you need to ensure that it has not "
"been tampered with."
msgstr ""
"データが改竄されていないことを保証したい場合は、 :mod:`hmac` による鍵付きハッ"
"シュ化を検討してください。"
#: ../../library/pickle.rst:39
msgid ""
"Safer serialization formats such as :mod:`json` may be more appropriate if "
"you are processing untrusted data. See :ref:`comparison-with-json`."
msgstr ""
"信頼できないデータを処理する場合 :mod:`json` のようなより安全な直列化形式の方"
"が適切でしょう。 :ref:`comparison-with-json` を参照してください。"
#: ../../library/pickle.rst:44
msgid "Relationship to other Python modules"
msgstr "他の Python モジュールとの関係"
#: ../../library/pickle.rst:47
msgid "Comparison with ``marshal``"
msgstr "``marshal`` との比較"
#: ../../library/pickle.rst:49
msgid ""
"Python has a more primitive serialization module called :mod:`marshal`, but "
"in general :mod:`!pickle` should always be the preferred way to serialize "
"Python objects. :mod:`marshal` exists primarily to support Python's :file:`."
"pyc` files."
msgstr ""
#: ../../library/pickle.rst:54
msgid ""
"The :mod:`!pickle` module differs from :mod:`marshal` in several significant "
"ways:"
msgstr ""
#: ../../library/pickle.rst:56
msgid ""
":mod:`marshal` cannot be used to serialize user-defined classes and their "
"instances. :mod:`!pickle` can save and restore class instances "
"transparently, however the class definition must be importable and live in "
"the same module as when the object was pickled."
msgstr ""
#: ../../library/pickle.rst:61
msgid ""
"The :mod:`marshal` serialization format is not guaranteed to be portable "
"across Python versions. Because its primary job in life is to support :file:"
"`.pyc` files, the Python implementers reserve the right to change the "
"serialization format in non-backwards compatible ways should the need arise. "
"The :mod:`!pickle` serialization format is guaranteed to be backwards "
"compatible across Python releases provided a compatible pickle protocol is "
"chosen and pickling and unpickling code deals with Python 2 to Python 3 type "
"differences if your data is crossing that unique breaking change language "
"boundary."
msgstr ""
#: ../../library/pickle.rst:74
msgid "Comparison with ``json``"
msgstr "``json`` との比較"
#: ../../library/pickle.rst:76
msgid ""
"There are fundamental differences between the pickle protocols and `JSON "
"(JavaScript Object Notation) <https://json.org>`_:"
msgstr ""
"pickle プロトコルと `JSON (JavaScript Object Notation) <https://json.org>`_ "
"との基本的な違いは以下のとおりです:"
#: ../../library/pickle.rst:79
msgid ""
"JSON is a text serialization format (it outputs unicode text, although most "
"of the time it is then encoded to ``utf-8``), while pickle is a binary "
"serialization format;"
msgstr ""
"JSON はテキストの直列化フォーマット (大抵の場合 ``utf-8`` にエンコードされま"
"すが、その出力は Unicode 文字列です) で、pickle はバイナリの直列化フォーマッ"
"トです;"
#: ../../library/pickle.rst:83
msgid "JSON is human-readable, while pickle is not;"
msgstr "JSON は人間が読める形式ですが、pickle はそうではありません;"
#: ../../library/pickle.rst:85
msgid ""
"JSON is interoperable and widely used outside of the Python ecosystem, while "
"pickle is Python-specific;"
msgstr ""
"JSON は相互運用可能で Python 以外でも広く使用されていますが、pickle は "
"Python 固有です;"
#: ../../library/pickle.rst:88
msgid ""
"JSON, by default, can only represent a subset of the Python built-in types, "
"and no custom classes; pickle can represent an extremely large number of "
"Python types (many of them automatically, by clever usage of Python's "
"introspection facilities; complex cases can be tackled by implementing :ref:"
"`specific object APIs <pickle-inst>`);"
msgstr ""
"JSON は、デフォルトでは Python の組み込み型の一部しか表現することができず、カ"
"スタムクラスに対しても行えません; pickle は極めて多くの Python 組み込み型を表"
"現できます (その多くは賢い Python 内省機構によって自動的に行われます; 複雑な"
"ケースでは :ref:`固有のオブジェクト API <pickle-inst>` によって対応できま"
"す)。"
#: ../../library/pickle.rst:94
msgid ""
"Unlike pickle, deserializing untrusted JSON does not in itself create an "
"arbitrary code execution vulnerability."
msgstr ""
"pickleとは異なり、信頼できないJSONを復元するだけでは、任意のコードを実行でき"
"る脆弱性は発生しません。"
#: ../../library/pickle.rst:98
msgid ""
"The :mod:`json` module: a standard library module allowing JSON "
"serialization and deserialization."
msgstr ""
":mod:`json` モジュール: JSON への直列化および復元を行うための標準ライブラリモ"
"ジュール。"
#: ../../library/pickle.rst:105
msgid "Data stream format"
msgstr "データストリームの形式"
#: ../../library/pickle.rst:110
msgid ""
"The data format used by :mod:`!pickle` is Python-specific. This has the "
"advantage that there are no restrictions imposed by external standards such "
"as JSON (which can't represent pointer sharing); however it means that non-"
"Python programs may not be able to reconstruct pickled Python objects."
msgstr ""
#: ../../library/pickle.rst:115
msgid ""
"By default, the :mod:`!pickle` data format uses a relatively compact binary "
"representation. If you need optimal size characteristics, you can "
"efficiently :doc:`compress <archiving>` pickled data."
msgstr ""
#: ../../library/pickle.rst:119
msgid ""
"The module :mod:`pickletools` contains tools for analyzing data streams "
"generated by :mod:`!pickle`. :mod:`pickletools` source code has extensive "
"comments about opcodes used by pickle protocols."
msgstr ""
#: ../../library/pickle.rst:123
msgid ""
"There are currently 6 different protocols which can be used for pickling. "
"The higher the protocol used, the more recent the version of Python needed "
"to read the pickle produced."
msgstr ""
"現在 pickle 化には 6 種類のプロトコルを使用できます。より高いプロトコルを使用"
"するほど、作成された pickle を読み込むためにより高い Python のバージョンが必"
"要になります。"
#: ../../library/pickle.rst:127
msgid ""
"Protocol version 0 is the original \"human-readable\" protocol and is "
"backwards compatible with earlier versions of Python."
msgstr ""
"プロトコルバージョン 0 はオリジナルの「人間に判読可能な」プロトコルで、"
"Python の初期のバージョンとの後方互換性を持ちます。"
#: ../../library/pickle.rst:130
msgid ""
"Protocol version 1 is an old binary format which is also compatible with "
"earlier versions of Python."
msgstr ""
"プロトコルバージョン 1 は旧形式のバイナリフォーマットで、これも Python の初期"
"バージョンと互換性があります。"
#: ../../library/pickle.rst:133
msgid ""
"Protocol version 2 was introduced in Python 2.3. It provides much more "
"efficient pickling of :term:`new-style classes <new-style class>`. Refer "
"to :pep:`307` for information about improvements brought by protocol 2."
msgstr ""
"プロトコルバージョン 2 は Python 2.3 で導入されました。このバージョンでは :"
"term:`新方式のクラス <new-style class>` のより効率的な pickle 化を提供しまし"
"た。プロトコル 2 による改良に関する情報は :pep:`307` を参照してください。"
#: ../../library/pickle.rst:137
msgid ""
"Protocol version 3 was added in Python 3.0. It has explicit support for :"
"class:`bytes` objects and cannot be unpickled by Python 2.x. This was the "
"default protocol in Python 3.0--3.7."
msgstr ""
"プロトコルバージョン 3 は Python 3 で追加されました。 :class:`bytes` オブジェ"
"クトを明示的にサポートしており、 Python 2.x で unpickle することはできませ"
"ん。これは Python 3.0から3.7のデフォルトプロトコルでした。"
#: ../../library/pickle.rst:141
msgid ""
"Protocol version 4 was added in Python 3.4. It adds support for very large "
"objects, pickling more kinds of objects, and some data format "
"optimizations. This was the default protocol in Python 3.8--3.13. Refer to :"
"pep:`3154` for information about improvements brought by protocol 4."
msgstr ""
"プロトコルバージョン 4 は Python 3.4 で追加されました。このバージョンでは巨大"
"なオブジェクトのサポート、より多くの種類のオブジェクトの pickle 化、および一"
"部のデータ形式の最適化が行われました。これはPython 3.8から3.13 までのデフォル"
"トプロトコルでした。プロトコル 4 による改良に関する情報は :pep:`3154` を参照"
"してください。"
#: ../../library/pickle.rst:147
msgid ""
"Protocol version 5 was added in Python 3.8. It adds support for out-of-band "
"data and speedup for in-band data. It is the default protocol starting with "
"Python 3.14. Refer to :pep:`574` for information about improvements brought "
"by protocol 5."
msgstr ""
"プロトコルバージョン 5 は Python 3.8 で追加されました。このバージョンでは帯域"
"外データのサポートが追加され、また帯域内データに対するパフォーマンスが向上し"
"ます。これはPython 3.14からのデフォルトプロトコルです。プロトコルバージョン "
"5 によってもたらされる改善についての情報は :pep:`574` を参照してください。"
#: ../../library/pickle.rst:153
msgid ""
"Serialization is a more primitive notion than persistence; although :mod:`!"
"pickle` reads and writes file objects, it does not handle the issue of "
"naming persistent objects, nor the (even more complicated) issue of "
"concurrent access to persistent objects. The :mod:`!pickle` module can "
"transform a complex object into a byte stream and it can transform the byte "
"stream into an object with the same internal structure. Perhaps the most "
"obvious thing to do with these byte streams is to write them onto a file, "
"but it is also conceivable to send them across a network or store them in a "
"database. The :mod:`shelve` module provides a simple interface to pickle "
"and unpickle objects on DBM-style database files."
msgstr ""
#: ../../library/pickle.rst:166
msgid "Module Interface"
msgstr "モジュールインターフェース"
#: ../../library/pickle.rst:168
msgid ""
"To serialize an object hierarchy, you simply call the :func:`dumps` "
"function. Similarly, to de-serialize a data stream, you call the :func:"
"`loads` function. However, if you want more control over serialization and "
"de-serialization, you can create a :class:`Pickler` or an :class:`Unpickler` "
"object, respectively."
msgstr ""
"オブジェクト階層を直列化するには、:func:`dumps` 関数を呼ぶだけです。同様に、"
"データストリームを復元するには、:func:`loads` 関数を呼びます。しかし、直列化"
"および復元に対してより多くのコントロールを行いたい場合、それぞれ :class:"
"`Pickler` または :class:`Unpickler` オブジェクトを作成することができます。"
#: ../../library/pickle.rst:173
msgid "The :mod:`!pickle` module provides the following constants:"
msgstr ""
#: ../../library/pickle.rst:178
msgid ""
"An integer, the highest :ref:`protocol version <pickle-protocols>` "
"available. This value can be passed as a *protocol* value to functions :"
"func:`dump` and :func:`dumps` as well as the :class:`Pickler` constructor."
msgstr ""
"利用可能なうち最も高い :ref:`プロトコルバージョン <pickle-protocols>` (整"
"数)。この値は *protocol* 値として関数 :func:`dump` および :func:`dumps` "
"と、:class:`Pickler` コンストラクターに渡すことができます。"
#: ../../library/pickle.rst:185
msgid ""
"An integer, the default :ref:`protocol version <pickle-protocols>` used for "
"pickling. May be less than :data:`HIGHEST_PROTOCOL`. Currently the default "
"protocol is 5, introduced in Python 3.8 and incompatible with previous "
"versions. This version introduces support for out-of-band buffers, where :"
"pep:`3118`-compatible data can be transmitted separately from the main "
"pickle stream."
msgstr ""
#: ../../library/pickle.rst:194
msgid "The default protocol is 3."
msgstr "デフォルトプロトコルは 3 です。"
#: ../../library/pickle.rst:198
msgid "The default protocol is 4."
msgstr "デフォルトプロトコルは 4 です。"
#: ../../library/pickle.rst:202
msgid "The default protocol is 5."
msgstr "デフォルトプロトコルは 5 です。"
#: ../../library/pickle.rst:204
msgid ""
"The :mod:`!pickle` module provides the following functions to make the "
"pickling process more convenient:"
msgstr ""
#: ../../library/pickle.rst:209
msgid ""
"Write the pickled representation of the object *obj* to the open :term:`file "
"object` *file*. This is equivalent to ``Pickler(file, protocol).dump(obj)``."
msgstr ""
"オブジェクト *obj* を pickle 化し、すでにオープンしている :term:`ファイルオブ"
"ジェクト <file object>` *file* に書き込みます。``Pickler(file, protocol)."
"dump(obj)`` と等価です。"
#: ../../library/pickle.rst:213
msgid ""
"Arguments *file*, *protocol*, *fix_imports* and *buffer_callback* have the "
"same meaning as in the :class:`Pickler` constructor."
msgstr ""
"引数 *file*, *protocol*, *fix_imports* および *buffer_callback* は :class:"
"`Pickler` のコンストラクタと同じ意味になります。"
#: ../../library/pickle.rst:216 ../../library/pickle.rst:227
#: ../../library/pickle.rst:319
msgid "The *buffer_callback* argument was added."
msgstr "*buffer_callback* 引数が追加されました。"
#: ../../library/pickle.rst:221
msgid ""
"Return the pickled representation of the object *obj* as a :class:`bytes` "
"object, instead of writing it to a file."
msgstr ""
"ファイルに書く代わりに、:class:`bytes` オブジェクトとしてオブジェクト *obj* "
"の pickle 表現を返します。"
#: ../../library/pickle.rst:224
msgid ""
"Arguments *protocol*, *fix_imports* and *buffer_callback* have the same "
"meaning as in the :class:`Pickler` constructor."
msgstr ""
"引数 *protocol*, *fix_imports* および *buffer_callback* は :class:`Pickler` "
"のコンストラクタと同じ意味になります。"
#: ../../library/pickle.rst:232
msgid ""
"Read the pickled representation of an object from the open :term:`file "
"object` *file* and return the reconstituted object hierarchy specified "
"therein. This is equivalent to ``Unpickler(file).load()``."
msgstr ""
"あるオブジェクトの pickle 化表現を、オープンしている :term:`ファイルオブジェ"
"クト <file object>` *file* から読み込み、その中で指定されているオブジェクト階"
"層に再構成して返します。これは ``Unpickler(file).load()`` と等価です。"
#: ../../library/pickle.rst:236 ../../library/pickle.rst:251
msgid ""
"The protocol version of the pickle is detected automatically, so no protocol "
"argument is needed. Bytes past the pickled representation of the object are "
"ignored."
msgstr ""
"pickle のプロトコルバージョンは自動的に検出されます。したがって protocol 引数"
"は必要ありません。pickle 化オブジェクト表現より後のバイト列は無視されます。"
#: ../../library/pickle.rst:240
msgid ""
"Arguments *file*, *fix_imports*, *encoding*, *errors*, *strict* and "
"*buffers* have the same meaning as in the :class:`Unpickler` constructor."
msgstr ""
"引数 *file*, *fix_imports*, *encoding*, *errors*, *strict* および *buffers* "
"は :class:`Unpickler` のコンストラクタと同じ意味になります。"
#: ../../library/pickle.rst:243 ../../library/pickle.rst:258
#: ../../library/pickle.rst:433
msgid "The *buffers* argument was added."
msgstr "*buffers* 引数が追加されました。"
#: ../../library/pickle.rst:248
msgid ""
"Return the reconstituted object hierarchy of the pickled representation "
"*data* of an object. *data* must be a :term:`bytes-like object`."
msgstr ""
"オブジェクトのピックル化表現 *data* から再構成されたオブジェクト階層を返しま"
"す。 *data* は バイトライクオブジェクト (:term:`bytes-like object`) でなけれ"
"ばなりません。"
#: ../../library/pickle.rst:255
msgid ""
"Arguments *fix_imports*, *encoding*, *errors*, *strict* and *buffers* have "
"the same meaning as in the :class:`Unpickler` constructor."
msgstr ""
"引数 *fix_imports*, *encoding*, *errors*, *strict* および *buffers* は :"
"class:`Unpickler` のコンストラクタと同じ意味になります。"
#: ../../library/pickle.rst:262
msgid "The :mod:`!pickle` module defines three exceptions:"
msgstr ""
#: ../../library/pickle.rst:266
msgid ""
"Common base class for the other pickling exceptions. It inherits from :exc:"
"`Exception`."
msgstr ""
"他の pickle 化例外の共通基底クラス。:exc:`Exception` を継承しています。"
#: ../../library/pickle.rst:271
msgid ""
"Error raised when an unpicklable object is encountered by :class:`Pickler`. "
"It inherits from :exc:`PickleError`."
msgstr ""
":class:`Pickler` が pickle 化不可能なオブジェクトに遭遇したときに送出されるエ"
"ラー。:exc:`PickleError` を継承しています。"
#: ../../library/pickle.rst:274
msgid ""
"Refer to :ref:`pickle-picklable` to learn what kinds of objects can be "
"pickled."
msgstr ""
"どんな種類のオブジェクトが pickle 化できるのか確認するには :ref:`pickle-"
"picklable` を参照してください。"
#: ../../library/pickle.rst:279
msgid ""
"Error raised when there is a problem unpickling an object, such as a data "
"corruption or a security violation. It inherits from :exc:`PickleError`."
msgstr ""
"データ破損やセキュリティ違反のような、オブジェクトを非 pickle 化するのに問題"
"がある場合に送出されるエラー。:exc:`PickleError` を継承します。"
#: ../../library/pickle.rst:282
msgid ""
"Note that other exceptions may also be raised during unpickling, including "
"(but not necessarily limited to) AttributeError, EOFError, ImportError, and "
"IndexError."
msgstr ""
"非 picke 化の最中に他の例外が送出されることもあるので注意してください。これに"
"は AttributeError, EOFError, ImportError, IndexError が含まれます (ただし必ず"
"しもこれらに限定されません)。"
#: ../../library/pickle.rst:287
msgid ""
"The :mod:`!pickle` module exports three classes, :class:`Pickler`, :class:"
"`Unpickler` and :class:`PickleBuffer`:"
msgstr ""
#: ../../library/pickle.rst:292
msgid "This takes a binary file for writing a pickle data stream."
msgstr ""
"pickle 化されたオブジェクトのデータストリームを書き込むためのバイナリファイル"
"を引数にとります。"
#: ../../library/pickle.rst:294
msgid ""
"The optional *protocol* argument, an integer, tells the pickler to use the "
"given protocol; supported protocols are 0 to :data:`HIGHEST_PROTOCOL`. If "
"not specified, the default is :data:`DEFAULT_PROTOCOL`. If a negative "
"number is specified, :data:`HIGHEST_PROTOCOL` is selected."
msgstr ""
"任意の引数 *protocol* は、整数で、pickle 化で使用するプロトコルを指定します; "
"サポートされているプロトコルは 0 から :data:`HIGHEST_PROTOCOL` までになりま"
"す。指定されない場合、:data:`DEFAULT_PROTOCOL` が使用されます。負数が与えられ"
"た場合、:data:`HIGHEST_PROTOCOL` が使用されます。"
#: ../../library/pickle.rst:299
msgid ""
"The *file* argument must have a write() method that accepts a single bytes "
"argument. It can thus be an on-disk file opened for binary writing, an :"
"class:`io.BytesIO` instance, or any other custom object that meets this "
"interface."
msgstr ""
"引数 *file* は、1 バイトの引数一つを受け付ける write() メソッドを持たなければ"
"なりません。すなわち、*file* には、バイナリの書き込み用にオープンされたファイ"
"ルオブジェクト、:class:`io.BytesIO` オブジェクト、このインターフェースに適合"
"するその他のカスタムオブジェクトをとることができます。"
#: ../../library/pickle.rst:304
msgid ""
"If *fix_imports* is true and *protocol* is less than 3, pickle will try to "
"map the new Python 3 names to the old module names used in Python 2, so that "
"the pickle data stream is readable with Python 2."
msgstr ""
"*fix_imports* が真であり、かつ、*protocol* が 3 未満の場合、pickle は新しい "
"Python 3 の名前と Python 2 で使用されていた古いモジュール名との対応付けを試み"
"るので、pickle データストリームは Python 2 でも読み込み可能です。"
#: ../../library/pickle.rst:308
msgid ""
"If *buffer_callback* is ``None`` (the default), buffer views are serialized "
"into *file* as part of the pickle stream."
msgstr ""
"*buffer_callback* が ``None`` (デフォルト) の場合、バッファビューはストリーム"
"の一部として*file* 中に直列化されます。"
#: ../../library/pickle.rst:311
msgid ""
"If *buffer_callback* is not ``None``, then it can be called any number of "
"times with a buffer view. If the callback returns a false value (such as "
"``None``), the given buffer is :ref:`out-of-band <pickle-oob>`; otherwise "
"the buffer is serialized in-band, i.e. inside the pickle stream."
msgstr ""
"*buffer_callback* が ``None`` でない場合、バッファビューを引数として何度でも"
"呼び出すことができる関数です。コールバック関数が偽値 (``None`` など) を返す"
"と、与えられたバッファは :ref:`アウトオブバウンド管理 (out-of-band) <pickle-"
"oob>` となります; そうでない場合はインバンドで、すなわち pickle ストリーム内"
"で、直列化されます。"
#: ../../library/pickle.rst:316
msgid ""
"It is an error if *buffer_callback* is not ``None`` and *protocol* is "
"``None`` or smaller than 5."
msgstr ""
"*buffer_callback* が ``None`` でなく、かつ *protocol* が ``None`` または 5 よ"
"り小さい場合はエラーとなります。"
#: ../../library/pickle.rst:324
msgid ""
"Write the pickled representation of *obj* to the open file object given in "
"the constructor."
msgstr ""
"*obj* の pickle 化表現を、コンストラクターで与えられた、すでにオープンしてい"
"るファイルオブジェクトに書き込みます。"
#: ../../library/pickle.rst:329
msgid "Do nothing by default. This exists so a subclass can override it."
msgstr ""
"デフォルトでは何もしません。このメソッドはサブクラスがオーバーライドできるよ"
"うに存在します。"
#: ../../library/pickle.rst:331
msgid ""
"If :meth:`persistent_id` returns ``None``, *obj* is pickled as usual. Any "
"other value causes :class:`Pickler` to emit the returned value as a "
"persistent ID for *obj*. The meaning of this persistent ID should be "
"defined by :meth:`Unpickler.persistent_load`. Note that the value returned "
"by :meth:`persistent_id` cannot itself have a persistent ID."
msgstr ""
":meth:`persistent_id` が ``None`` を返す場合、通常通り *obj* が pickle 化され"
"ます。それ以外の値を返した場合、:class:`Pickler` がその値を *obj* のために永"
"続的な ID として出力するようになります。この永続的な ID の意味は :meth:"
"`Unpickler.persistent_load` によって定義されています。:meth:`persistent_id` "
"によって返された値自身は永続的な ID を持つことができないことに注意してくださ"
"い。"
#: ../../library/pickle.rst:337 ../../library/pickle.rst:451
msgid "See :ref:`pickle-persistent` for details and examples of uses."
msgstr ""
"詳細および使用例については :ref:`pickle-persistent` を参照してください。"
#: ../../library/pickle.rst:339
msgid ""
"Add the default implementation of this method in the C implementation of :"
"class:`!Pickler`."
msgstr ""
#: ../../library/pickle.rst:345
msgid ""
"A pickler object's dispatch table is a registry of *reduction functions* of "
"the kind which can be declared using :func:`copyreg.pickle`. It is a "
"mapping whose keys are classes and whose values are reduction functions. A "
"reduction function takes a single argument of the associated class and "
"should conform to the same interface as a :meth:`~object.__reduce__` method."
msgstr ""
"pickler オブジェクトのディスパッチテーブルは :func:`copyreg.pickle` を使用し"
"て宣言できる種類の *reduction functions* のレジストリです。これはキーがクラス"
"でその値が減少関数のマッピング型オブジェクトです。減少関数は関連するクラスの"
"引数を 1 個とり、:meth:`~object.__reduce__` メソッドと同じインターフェースで"
"なければなりません。"
#: ../../library/pickle.rst:353
msgid ""
"By default, a pickler object will not have a :attr:`dispatch_table` "
"attribute, and it will instead use the global dispatch table managed by the :"
"mod:`copyreg` module. However, to customize the pickling for a specific "
"pickler object one can set the :attr:`dispatch_table` attribute to a dict-"
"like object. Alternatively, if a subclass of :class:`Pickler` has a :attr:"
"`dispatch_table` attribute then this will be used as the default dispatch "
"table for instances of that class."
msgstr ""
"デフォルトでは、pickler オブジェクトは :attr:`dispatch_table` 属性を持たず、"
"代わりに :mod:`copyreg` モジュールによって管理されるグローバルなディスパッチ"
"テーブルを使用します。しかし、特定の pickler オブジェクトによる pickle 化をカ"
"スタマイズするために :attr:`dispatch_table` 属性に dict-like オブジェクトを設"
"定することができます。あるいは、:class:`Pickler` のサブクラスが :attr:"
"`dispatch_table` 属性を持てば、そのクラスのインスタンスに対するデフォルトの"
"ディスパッチテーブルとして使用されます。"
#: ../../library/pickle.rst:362
msgid "See :ref:`pickle-dispatch` for usage examples."
msgstr "使用例については :ref:`pickle-dispatch` を参照してください。"
#: ../../library/pickle.rst:368
msgid ""
"Special reducer that can be defined in :class:`Pickler` subclasses. This "
"method has priority over any reducer in the :attr:`dispatch_table`. It "
"should conform to the same interface as a :meth:`~object.__reduce__` method, "
"and can optionally return :data:`NotImplemented` to fallback on :attr:"
"`dispatch_table`-registered reducers to pickle ``obj``."
msgstr ""
":class:`Pickler` のサブクラスで定義可能な特殊なリデューサ (reducer) です。こ"
"のメソッドは :attr:`dispatch_table` 内のいかなるリデューサよりも優先されま"
"す。このメソッドは :meth:`~object.__reduce__` メソッドのインターフェースと適"
"合していなければなりません。また、メソッドが :data:`NotImplemented` を返すこ"
"とにより、 :attr:`dispatch_table` に登録されたリデューサにフォールバックして "
"``obj`` を直列化することもできます。"
#: ../../library/pickle.rst:374
msgid "For a detailed example, see :ref:`reducer_override`."
msgstr "詳細な例については、 :ref:`reducer_override` を参照してください。"
#: ../../library/pickle.rst:380
msgid ""
"Deprecated. Enable fast mode if set to a true value. The fast mode disables "
"the usage of memo, therefore speeding the pickling process by not generating "
"superfluous PUT opcodes. It should not be used with self-referential "
"objects, doing otherwise will cause :class:`Pickler` to recurse infinitely."
msgstr ""
"廃止予定です。真値が設定されれば高速モードを有効にします。高速モードは、メモ"
"の使用を無効にします。それにより余分な PUT 命令コードを生成しなくなるので "
"pickle 化処理が高速化します。自己参照オブジェクトに対しては使用すべきではあり"
"ません。さもなければ :class:`Pickler` に無限再帰を起こさせるでしょう。"
#: ../../library/pickle.rst:386
msgid "Use :func:`pickletools.optimize` if you need more compact pickles."
msgstr ""
"よりコンパクトな pickle 化を必要とする場合は、:func:`pickletools.optimize` を"
"使用してください。"
#: ../../library/pickle.rst:390
msgid "Clears the pickler's \"memo\"."
msgstr ""
#: ../../library/pickle.rst:392
msgid ""
"The memo is the data structure that remembers which objects the pickler has "
"already seen, so that shared or recursive objects are pickled by reference "
"and not by value. This method is useful when re-using picklers."
msgstr ""
#: ../../library/pickle.rst:400
msgid "This takes a binary file for reading a pickle data stream."
msgstr ""
"これは pickle データストリームの読み込みのためにバイナリファイルをとります。"
#: ../../library/pickle.rst:402
msgid ""
"The protocol version of the pickle is detected automatically, so no protocol "
"argument is needed."
msgstr ""
"pickle のプロトコルバージョンは自動的に検出されます。したがって protocol 引数"
"は必要ありません。"
#: ../../library/pickle.rst:405
msgid ""
"The argument *file* must have three methods, a read() method that takes an "
"integer argument, a readinto() method that takes a buffer argument and a "
"readline() method that requires no arguments, as in the :class:`io."
"BufferedIOBase` interface. Thus *file* can be an on-disk file opened for "
"binary reading, an :class:`io.BytesIO` object, or any other custom object "
"that meets this interface."
msgstr ""
"引数 *file* は :class:`io.BufferedIOBase` のインターフェースと同様に、整数を"
"引数にとる read() 、バッファを引数にとる readinto() 、引数を取らない "
"readline() の3つのメソッドを持たなければなりません。したがって、 *file* はバ"
"イナリ読み込みモードでオープンされたディスク上のファイル、 :class:`io."
"BytesIO` オブジェクト、または上記インターフェース要件を満たす任意のカスタムオ"
"ブジェクトのいずれかです。"
#: ../../library/pickle.rst:412
msgid ""
"The optional arguments *fix_imports*, *encoding* and *errors* are used to "
"control compatibility support for pickle stream generated by Python 2. If "
"*fix_imports* is true, pickle will try to map the old Python 2 names to the "
"new names used in Python 3. The *encoding* and *errors* tell pickle how to "
"decode 8-bit string instances pickled by Python 2; these default to 'ASCII' "
"and 'strict', respectively. The *encoding* can be 'bytes' to read these 8-"
"bit string instances as bytes objects. Using ``encoding='latin1'`` is "
"required for unpickling NumPy arrays and instances of :class:`~datetime."
"datetime`, :class:`~datetime.date` and :class:`~datetime.time` pickled by "
"Python 2."
msgstr ""
"オプション引数 *fix_imports*, *encoding* および *errors* はPython 2で生成され"
"た pickle ストリームに対する互換性サポートを制御するために使われます。 "
"*fix_imports* が真の場合、 pickle は古い Python 2 の名前を Python 3 の新しい"
"名前に対応づけようとします。 *encoding* と *errors* は pickle に Python 2 "
"で pickle 化された 8 ビット文字列をデコードする方法を指定します; これらの引"
"数のデフォルト値はそれぞれ 'ASCII' と 'strict' です。 *encoding* は 8 ビット"
"文字列インスタンスをバイトオブジェクトとして読み込む場合は 'bytes' を指定しま"
"す。 Python 2 で pickle 化された NumPy 配列および :class:`~datetime."
"datetime`, :class:`~datetime.date`, :class:`~datetime.time` の各インスタンス"
"を非 pickle 化するためには ``encoding='latin1'`` を使う必要があります。"
#: ../../library/pickle.rst:423
msgid ""
"If *buffers* is ``None`` (the default), then all data necessary for "
"deserialization must be contained in the pickle stream. This means that the "
"*buffer_callback* argument was ``None`` when a :class:`Pickler` was "
"instantiated (or when :func:`dump` or :func:`dumps` was called)."
msgstr ""
"*buffers* が ``None`` (デフォルト値) の場合、非直列化に必要な全てのデータは "
"pickle ストリームに含まれている必要があります。これは :class:`Pickler` がイン"
"スタンス化されたとき (または :func:`dump` や :func:`dumps` が呼び出されたと"
"き) に *buffer_callback* 引数に ``None`` を指定したことに相当します。"
#: ../../library/pickle.rst:428
msgid ""
"If *buffers* is not ``None``, it should be an iterable of buffer-enabled "
"objects that is consumed each time the pickle stream references an :ref:`out-"
"of-band <pickle-oob>` buffer view. Such buffers have been given in order to "
"the *buffer_callback* of a Pickler object."
msgstr ""
"*buffers* が ``None`` でない場合、各イテレーションで :ref:`アウトオブバウン"
"ド (out-of-band) <pickle-oob>` のバッファビューを参照する pickle ストリームを"
"消費する、バッファ対応のイテラブルでなければなりません。ここに指定するバッ"
"ファは Pickler オブジェクトの *buffer_callback* に順番に渡されたものです。"
#: ../../library/pickle.rst:438
msgid ""
"Read the pickled representation of an object from the open file object given "
"in the constructor, and return the reconstituted object hierarchy specified "
"therein. Bytes past the pickled representation of the object are ignored."
msgstr ""
"コンストラクターで与えられたオープンしたファイルオブジェクトからオブジェクト"
"の pickle 化表現を読み込み、その中で指定されたオブジェクト階層に再構成して返"
"します。オブジェクトの pickle 化表現より後のバイト列は無視されます。"
#: ../../library/pickle.rst:445
msgid "Raise an :exc:`UnpicklingError` by default."
msgstr "デフォルトで :exc:`UnpicklingError` を送出します。"
#: ../../library/pickle.rst:447
msgid ""
"If defined, :meth:`persistent_load` should return the object specified by "
"the persistent ID *pid*. If an invalid persistent ID is encountered, an :"
"exc:`UnpicklingError` should be raised."
msgstr ""
"もし定義されていれば、:meth:`persistent_load` は永続的な ID *pid* によって指"
"定されたオブジェクトを返す必要があります。永続的な ID が無効な場合、:exc:"
"`UnpicklingError` を送出しなければなりません。"
#: ../../library/pickle.rst:453
msgid ""
"Add the default implementation of this method in the C implementation of :"
"class:`!Unpickler`."
msgstr ""
#: ../../library/pickle.rst:459
msgid ""
"Import *module* if necessary and return the object called *name* from it, "
"where the *module* and *name* arguments are :class:`str` objects. Note, "
"unlike its name suggests, :meth:`find_class` is also used for finding "
"functions."
msgstr ""
"必要なら *module* をインポートして、そこから *name* という名前のオブジェクト"
"を返します。ここで *module* および *name* 引数は :class:`str` オブジェクトで"
"す。その名前が示唆することに反して :meth:`find_class` は関数を探すためにも使"
"われることに注意してください。"
#: ../../library/pickle.rst:464
msgid ""
"Subclasses may override this to gain control over what type of objects and "
"how they can be loaded, potentially reducing security risks. Refer to :ref:"
"`pickle-restrict` for details."
msgstr ""
"サブクラスは、どんな型のオブジェクトを、どのようにロードするか (潜在的にはセ"
"キュリティリスクの減少) に関する制御を得るためにこれをオーバーライドすること"
"ができます。詳細に関しては :ref:`pickle-restrict` を参照してください。"
#: ../../library/pickle.rst:468
msgid ""
"Raises an :ref:`auditing event <auditing>` ``pickle.find_class`` with "
"arguments ``module``, ``name``."
msgstr ""
"引数 ``modulet``, ``name`` を指定して :ref:`監査イベント <auditing>` "
"``pickle.find_class`` を送出します。 "
#: ../../library/pickle.rst:472
msgid ""
"A wrapper for a buffer representing picklable data. *buffer* must be a :ref:"
"`buffer-providing <bufferobjects>` object, such as a :term:`bytes-like "
"object` or a N-dimensional array."
msgstr ""
"pickle 可能なデータをあらわすバッファのラッパーです。 *buffer* はバッファライ"
"クなオブジェクト (:term:`bytes-like object`) や N 次元配列のような :ref:`バッ"
"ファ機能を提供する <bufferobjects>` オブジェクトでなければなりません。"
#: ../../library/pickle.rst:476
msgid ""
":class:`PickleBuffer` is itself a buffer provider, therefore it is possible "
"to pass it to other APIs expecting a buffer-providing object, such as :class:"
"`memoryview`."
msgstr ""
":class:`PickleBuffer` はそれ自身バッファ機能を提供します。したがってこのクラ"
"スのインスタンスを、バッファ機能を提供するオブジェクトを期待する :class:"
"`memoryview` など他の API に渡すことが可能です。"
#: ../../library/pickle.rst:480
msgid ""
":class:`PickleBuffer` objects can only be serialized using pickle protocol 5 "
"or higher. They are eligible for :ref:`out-of-band serialization <pickle-"
"oob>`."
msgstr ""
":class:`PickleBuffer` オブジェクトはプロトコル 5 以上でのみ直列化可能で、 :"
"ref:`アウトオブバウンド (out-of-band) の直列化 <pickle-oob>` に対応していま"
"す。"
#: ../../library/pickle.rst:488
msgid ""
"Return a :class:`memoryview` of the memory area underlying this buffer. The "
"returned object is a one-dimensional, C-contiguous memoryview with format "
"``B`` (unsigned bytes). :exc:`BufferError` is raised if the buffer is "
"neither C- nor Fortran-contiguous."
msgstr ""
"このバッファの背後にあるメモリ領域への :class:`memoryview` を返します。戻り値"
"のオブジェクトはフォーマット ``B`` (符号なしバイト) の C-連続な1次元のメモリ"
"ビューです。バッファが C-連続でも Fortran-連続でもない場合 :exc:"
"`BufferError` 例外が送出されます。"
#: ../../library/pickle.rst:495
msgid "Release the underlying buffer exposed by the PickleBuffer object."
msgstr ""
"PickleBuffer オブジェクトを通じてアクセスされる背後のバッファを解放します。"
#: ../../library/pickle.rst:501
msgid "What can be pickled and unpickled?"
msgstr "pickle 化、非 pickle 化できるもの"
#: ../../library/pickle.rst:503
msgid "The following types can be pickled:"
msgstr "以下の型は pickle 化できます:"
#: ../../library/pickle.rst:505
msgid ""
"built-in constants (``None``, ``True``, ``False``, ``Ellipsis``, and :data:"
"`NotImplemented`);"
msgstr ""
"組み込み定数(``None``, ``True``, ``False``, ``Ellipsis``, と :data:"
"`NotImplemented`)"
#: ../../library/pickle.rst:508
msgid "integers, floating-point numbers, complex numbers;"
msgstr "整数、浮動小数点数、複素数"
#: ../../library/pickle.rst:510
msgid "strings, bytes, bytearrays;"
msgstr "文字列、バイト列、バイト配列"
#: ../../library/pickle.rst:512
msgid ""
"tuples, lists, sets, and dictionaries containing only picklable objects;"
msgstr "pickle 化可能なオブジェクトからなるタプル、リスト、集合および辞書"
#: ../../library/pickle.rst:514
msgid ""
"functions (built-in and user-defined) accessible from the top level of a "
"module (using :keyword:`def`, not :keyword:`lambda`);"
msgstr ""
"モジュールのトップレベルで定義された関数 (:keyword:`def` で定義されたもののみ"
"で :keyword:`lambda` で定義されたものは含まない)"
#: ../../library/pickle.rst:517
msgid "classes accessible from the top level of a module;"
msgstr "モジュールのトップレベルで定義されているクラス"
#: ../../library/pickle.rst:519
msgid ""
"instances of such classes for which the result of calling :meth:`~object."
"__getstate__` is picklable (see section :ref:`pickle-inst` for details)."
msgstr ""
#: ../../library/pickle.rst:522
msgid ""
"Attempts to pickle unpicklable objects will raise the :exc:`PicklingError` "
"exception; when this happens, an unspecified number of bytes may have "
"already been written to the underlying file. Trying to pickle a highly "
"recursive data structure may exceed the maximum recursion depth, a :exc:"
"`RecursionError` will be raised in this case. You can carefully raise this "
"limit with :func:`sys.setrecursionlimit`."
msgstr ""
"pickle 化できないオブジェクトを pickle 化しようとすると、:exc:"
"`PicklingError` 例外が送出されます。この例外が起きたとき、すでに元のファイル"
"には未知の長さのバイト列が書き込まれている場合があります。極端に再帰的なデー"
"タ構造を pickle 化しようとした場合には再帰の深さ制限を越えてしまうかもしれ"
"ず、この場合には :exc:`RecursionError` が送出されます。この制限は、:func:"
"`sys.setrecursionlimit` で慎重に上げていくことは可能です。"
#: ../../library/pickle.rst:529
msgid ""
"Note that functions (built-in and user-defined) are pickled by fully :term:"
"`qualified name`, not by value. [#]_ This means that only the function name "
"is pickled, along with the name of the containing module and classes. "
"Neither the function's code, nor any of its function attributes are "
"pickled. Thus the defining module must be importable in the unpickling "
"environment, and the module must contain the named object, otherwise an "
"exception will be raised. [#]_"
msgstr ""
"関数 (組込みおよびユーザー定義) は、値ではなく、完全 :term:`修飾名 "
"<qualified name>` で pickle 化されます。[#]_ これは、関数名のみがそれを含ん"
"でいるモジュールおよびクラスの名前をともなって pickle 化されることを意味しま"
"す。関数のコードやその属性は pickle 化されません。すなわち、非 pickle 化する"
"環境で定義したモジュールがインポート可能な状態になっており、そのモジュール内"
"に関数名のオブジェクトが含まれていなければなりません。この条件を満たさなかっ"
"た場合は例外が送出されます。[#]_"
#: ../../library/pickle.rst:536
msgid ""
"Similarly, classes are pickled by fully qualified name, so the same "
"restrictions in the unpickling environment apply. Note that none of the "
"class's code or data is pickled, so in the following example the class "
"attribute ``attr`` is not restored in the unpickling environment::"
msgstr ""
"クラスも同様に完全修飾名で pickle 化されるので、unpickle 化環境には同じ制限が"
"課せられます。クラス中のコードやデータは何も pickle 化されないので、以下の例"
"ではクラス属性 ``attr`` が unpickle 化環境で復元されないことに注意してくださ"
"い::"
#: ../../library/pickle.rst:541
msgid ""
"class Foo:\n"
" attr = 'A class attribute'\n"
"\n"
"picklestring = pickle.dumps(Foo)"
msgstr ""
#: ../../library/pickle.rst:546
msgid ""
"These restrictions are why picklable functions and classes must be defined "
"at the top level of a module."
msgstr ""
"pickle 化可能な関数やクラスがモジュールのトップレベルで定義されていなければな"
"らないのはこれらの制限のためです。"
#: ../../library/pickle.rst:549
msgid ""
"Similarly, when class instances are pickled, their class's code and data are "
"not pickled along with them. Only the instance data are pickled. This is "
"done on purpose, so you can fix bugs in a class or add methods to the class "
"and still load objects that were created with an earlier version of the "
"class. If you plan to have long-lived objects that will see many versions "
"of a class, it may be worthwhile to put a version number in the objects so "
"that suitable conversions can be made by the class's :meth:`~object."
"__setstate__` method."
msgstr ""
"同様に、クラスのインスタンスが pickle 化された際、そのクラスのコードおよび"
"データはオブジェクトと一緒に pickle 化されることはありません。インスタンスの"
"データのみが pickle 化されます。この仕様は、クラス内のバグを修正したりメソッ"
"ドを追加した後でも、そのクラスの以前のバージョンで作られたオブジェクトを読み"
"出せるように意図的に行われています。あるクラスの多くのバージョンで使われるよ"
"うな長命なオブジェクトを作ろうと計画しているなら、そのクラスの :meth:"
"`~object.__setstate__` メソッドによって適切な変換が行われるようにオブジェクト"
"のバージョン番号を入れておくとよいかもしれません。"
#: ../../library/pickle.rst:561