-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy path2.4.po
More file actions
1553 lines (1285 loc) · 56.3 KB
/
2.4.po
File metadata and controls
1553 lines (1285 loc) · 56.3 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-2026, 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
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-04-11 16:45+0000\n"
"PO-Revision-Date: 2025-09-22 16:51+0000\n"
"Last-Translator: python-doc bot, 2025\n"
"Language-Team: Polish (https://app.transifex.com/python-doc/teams/5390/pl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pl\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && "
"(n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && "
"n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
msgid "What's New in Python 2.4"
msgstr ""
msgid "Author"
msgstr "Autor"
msgid "A.M. Kuchling"
msgstr ""
msgid ""
"This article explains the new features in Python 2.4.1, released on March "
"30, 2005."
msgstr ""
msgid ""
"Python 2.4 is a medium-sized release. It doesn't introduce as many changes "
"as the radical Python 2.2, but introduces more features than the "
"conservative 2.3 release. The most significant new language features are "
"function decorators and generator expressions; most other changes are to the "
"standard library."
msgstr ""
msgid ""
"According to the CVS change logs, there were 481 patches applied and 502 "
"bugs fixed between Python 2.3 and 2.4. Both figures are likely to be "
"underestimates."
msgstr ""
msgid ""
"This article doesn't attempt to provide a complete specification of every "
"single new feature, but instead provides a brief introduction to each "
"feature. For full details, you should refer to the documentation for Python "
"2.4, such as the Python Library Reference and the Python Reference Manual. "
"Often you will be referred to the PEP for a particular new feature for "
"explanations of the implementation and design rationale."
msgstr ""
msgid "PEP 218: Built-In Set Objects"
msgstr ""
msgid ""
"Python 2.3 introduced the :mod:`sets` module. C implementations of set data "
"types have now been added to the Python core as two new built-in types, "
"``set(iterable)`` and ``frozenset(iterable)``. They provide high speed "
"operations for membership testing, for eliminating duplicates from "
"sequences, and for mathematical operations like unions, intersections, "
"differences, and symmetric differences. ::"
msgstr ""
msgid ""
"The :func:`frozenset` type is an immutable version of :func:`set`. Since it "
"is immutable and hashable, it may be used as a dictionary key or as a member "
"of another set."
msgstr ""
msgid ""
"The :mod:`sets` module remains in the standard library, and may be useful if "
"you wish to subclass the :class:`Set` or :class:`ImmutableSet` classes. "
"There are currently no plans to deprecate the module."
msgstr ""
msgid ":pep:`218` - Adding a Built-In Set Object Type"
msgstr ""
msgid ""
"Originally proposed by Greg Wilson and ultimately implemented by Raymond "
"Hettinger."
msgstr ""
msgid "PEP 237: Unifying Long Integers and Integers"
msgstr ""
msgid ""
"The lengthy transition process for this PEP, begun in Python 2.2, takes "
"another step forward in Python 2.4. In 2.3, certain integer operations that "
"would behave differently after int/long unification triggered :exc:"
"`FutureWarning` warnings and returned values limited to 32 or 64 bits "
"(depending on your platform). In 2.4, these expressions no longer produce a "
"warning and instead produce a different result that's usually a long integer."
msgstr ""
msgid ""
"The problematic expressions are primarily left shifts and lengthy "
"hexadecimal and octal constants. For example, ``2 << 32`` results in a "
"warning in 2.3, evaluating to 0 on 32-bit platforms. In Python 2.4, this "
"expression now returns the correct answer, 8589934592."
msgstr ""
msgid ":pep:`237` - Unifying Long Integers and Integers"
msgstr ""
msgid ""
"Original PEP written by Moshe Zadka and GvR. The changes for 2.4 were "
"implemented by Kalle Svensson."
msgstr ""
msgid "PEP 289: Generator Expressions"
msgstr ""
msgid ""
"The iterator feature introduced in Python 2.2 and the :mod:`itertools` "
"module make it easier to write programs that loop through large data sets "
"without having the entire data set in memory at one time. List "
"comprehensions don't fit into this picture very well because they produce a "
"Python list object containing all of the items. This unavoidably pulls all "
"of the objects into memory, which can be a problem if your data set is very "
"large. When trying to write a functionally styled program, it would be "
"natural to write something like::"
msgstr ""
msgid "instead of ::"
msgstr ""
msgid ""
"The first form is more concise and perhaps more readable, but if you're "
"dealing with a large number of link objects you'd have to write the second "
"form to avoid having all link objects in memory at the same time."
msgstr ""
msgid ""
"Generator expressions work similarly to list comprehensions but don't "
"materialize the entire list; instead they create a generator that will "
"return elements one by one. The above example could be written as::"
msgstr ""
msgid ""
"Generator expressions always have to be written inside parentheses, as in "
"the above example. The parentheses signalling a function call also count, "
"so if you want to create an iterator that will be immediately passed to a "
"function you could write::"
msgstr ""
msgid ""
"Generator expressions differ from list comprehensions in various small ways. "
"Most notably, the loop variable (*obj* in the above example) is not "
"accessible outside of the generator expression. List comprehensions leave "
"the variable assigned to its last value; future versions of Python will "
"change this, making list comprehensions match generator expressions in this "
"respect."
msgstr ""
msgid ":pep:`289` - Generator Expressions"
msgstr ""
msgid ""
"Proposed by Raymond Hettinger and implemented by Jiwon Seo with early "
"efforts steered by Hye-Shik Chang."
msgstr ""
msgid "PEP 292: Simpler String Substitutions"
msgstr ""
msgid ""
"Some new classes in the standard library provide an alternative mechanism "
"for substituting variables into strings; this style of substitution may be "
"better for applications where untrained users need to edit templates."
msgstr ""
msgid "The usual way of substituting variables by name is the ``%`` operator::"
msgstr ""
msgid ""
"When writing the template string, it can be easy to forget the ``i`` or "
"``s`` after the closing parenthesis. This isn't a big problem if the "
"template is in a Python module, because you run the code, get an "
"\"Unsupported format character\" :exc:`ValueError`, and fix the problem. "
"However, consider an application such as Mailman where template strings or "
"translations are being edited by users who aren't aware of the Python "
"language. The format string's syntax is complicated to explain to such "
"users, and if they make a mistake, it's difficult to provide helpful "
"feedback to them."
msgstr ""
msgid ""
"PEP 292 adds a :class:`Template` class to the :mod:`string` module that uses "
"``$`` to indicate a substitution::"
msgstr ""
msgid ""
"If a key is missing from the dictionary, the :meth:`substitute` method will "
"raise a :exc:`KeyError`. There's also a :meth:`safe_substitute` method that "
"ignores missing keys::"
msgstr ""
msgid ":pep:`292` - Simpler String Substitutions"
msgstr ""
msgid "Written and implemented by Barry Warsaw."
msgstr ""
msgid "PEP 318: Decorators for Functions and Methods"
msgstr ""
msgid ""
"Python 2.2 extended Python's object model by adding static methods and class "
"methods, but it didn't extend Python's syntax to provide any new way of "
"defining static or class methods. Instead, you had to write a :keyword:"
"`def` statement in the usual way, and pass the resulting method to a :func:"
"`staticmethod` or :func:`classmethod` function that would wrap up the "
"function as a method of the new type. Your code would look like this::"
msgstr ""
msgid ""
"If the method was very long, it would be easy to miss or forget the :func:"
"`classmethod` invocation after the function body."
msgstr ""
msgid ""
"The intention was always to add some syntax to make such definitions more "
"readable, but at the time of 2.2's release a good syntax was not obvious. "
"Today a good syntax *still* isn't obvious but users are asking for easier "
"access to the feature; a new syntactic feature has been added to meet this "
"need."
msgstr ""
msgid ""
"The new feature is called \"function decorators\". The name comes from the "
"idea that :func:`classmethod`, :func:`staticmethod`, and friends are storing "
"additional information on a function object; they're *decorating* functions "
"with more details."
msgstr ""
msgid ""
"The notation borrows from Java and uses the ``'@'`` character as an "
"indicator. Using the new syntax, the example above would be written::"
msgstr ""
msgid ""
"The ``@classmethod`` is shorthand for the ``meth=classmethod(meth)`` "
"assignment. More generally, if you have the following::"
msgstr ""
msgid "It's equivalent to the following pre-decorator code::"
msgstr ""
msgid ""
"Decorators must come on the line before a function definition, one decorator "
"per line, and can't be on the same line as the def statement, meaning that "
"``@A def f(): ...`` is illegal. You can only decorate function definitions, "
"either at the module level or inside a class; you can't decorate class "
"definitions."
msgstr ""
msgid ""
"A decorator is just a function that takes the function to be decorated as an "
"argument and returns either the same function or some new object. The "
"return value of the decorator need not be callable (though it typically is), "
"unless further decorators will be applied to the result. It's easy to write "
"your own decorators. The following simple example just sets an attribute on "
"the function object::"
msgstr ""
msgid ""
"As a slightly more realistic example, the following decorator checks that "
"the supplied argument is an integer::"
msgstr ""
msgid ""
"An example in :pep:`318` contains a fancier version of this idea that lets "
"you both specify the required type and check the returned type."
msgstr ""
msgid ""
"Decorator functions can take arguments. If arguments are supplied, your "
"decorator function is called with only those arguments and must return a new "
"decorator function; this function must take a single function and return a "
"function, as previously described. In other words, ``@A @B @C(args)`` "
"becomes::"
msgstr ""
msgid ""
"Getting this right can be slightly brain-bending, but it's not too difficult."
msgstr ""
msgid ""
"A small related change makes the :attr:`func_name <function.__name__>` "
"attribute of functions writable. This attribute is used to display function "
"names in tracebacks, so decorators should change the name of any new "
"function that's constructed and returned."
msgstr ""
msgid ":pep:`318` - Decorators for Functions, Methods and Classes"
msgstr ""
msgid ""
"Written by Kevin D. Smith, Jim Jewett, and Skip Montanaro. Several people "
"wrote patches implementing function decorators, but the one that was "
"actually checked in was patch #979728, written by Mark Russell."
msgstr ""
msgid "https://wiki.python.org/moin/PythonDecoratorLibrary"
msgstr "https://wiki.python.org/moin/PythonDecoratorLibrary"
msgid "This Wiki page contains several examples of decorators."
msgstr ""
msgid "PEP 322: Reverse Iteration"
msgstr ""
msgid ""
"A new built-in function, ``reversed(seq)``, takes a sequence and returns an "
"iterator that loops over the elements of the sequence in reverse order. ::"
msgstr ""
msgid ""
"Compared to extended slicing, such as ``range(1,4)[::-1]``, :func:`reversed` "
"is easier to read, runs faster, and uses substantially less memory."
msgstr ""
msgid ""
"Note that :func:`reversed` only accepts sequences, not arbitrary iterators. "
"If you want to reverse an iterator, first convert it to a list with :func:"
"`list`. ::"
msgstr ""
msgid ":pep:`322` - Reverse Iteration"
msgstr ""
msgid "Written and implemented by Raymond Hettinger."
msgstr ""
msgid "PEP 324: New subprocess Module"
msgstr ""
msgid ""
"The standard library provides a number of ways to execute a subprocess, "
"offering different features and different levels of complexity. ``os."
"system(command)`` is easy to use, but slow (it runs a shell process which "
"executes the command) and dangerous (you have to be careful about escaping "
"the shell's metacharacters). The :mod:`!popen2` module offers classes that "
"can capture standard output and standard error from the subprocess, but the "
"naming is confusing. The :mod:`subprocess` module cleans this up, "
"providing a unified interface that offers all the features you might need."
msgstr ""
msgid ""
"Instead of :mod:`!popen2`'s collection of classes, :mod:`subprocess` "
"contains a single class called :class:`subprocess.Popen` whose constructor "
"supports a number of different keyword arguments. ::"
msgstr ""
msgid ""
"*args* is commonly a sequence of strings that will be the arguments to the "
"program executed as the subprocess. (If the *shell* argument is true, "
"*args* can be a string which will then be passed on to the shell for "
"interpretation, just as :func:`os.system` does.)"
msgstr ""
msgid ""
"*stdin*, *stdout*, and *stderr* specify what the subprocess's input, output, "
"and error streams will be. You can provide a file object or a file "
"descriptor, or you can use the constant ``subprocess.PIPE`` to create a pipe "
"between the subprocess and the parent."
msgstr ""
msgid "The constructor has a number of handy options:"
msgstr ""
msgid ""
"*close_fds* requests that all file descriptors be closed before running the "
"subprocess."
msgstr ""
msgid ""
"*cwd* specifies the working directory in which the subprocess will be "
"executed (defaulting to whatever the parent's working directory is)."
msgstr ""
msgid "*env* is a dictionary specifying environment variables."
msgstr ""
msgid ""
"*preexec_fn* is a function that gets called before the child is started."
msgstr ""
msgid ""
"*universal_newlines* opens the child's input and output using Python's :term:"
"`universal newlines` feature."
msgstr ""
msgid ""
"Once you've created the :class:`Popen` instance, you can call its :meth:"
"`wait` method to pause until the subprocess has exited, :meth:`poll` to "
"check if it's exited without pausing, or ``communicate(data)`` to send the "
"string *data* to the subprocess's standard input. ``communicate(data)`` "
"then reads any data that the subprocess has sent to its standard output or "
"standard error, returning a tuple ``(stdout_data, stderr_data)``."
msgstr ""
msgid ""
":func:`call` is a shortcut that passes its arguments along to the :class:"
"`Popen` constructor, waits for the command to complete, and returns the "
"status code of the subprocess. It can serve as a safer analog to :func:`os."
"system`::"
msgstr ""
msgid ""
"The command is invoked without use of the shell. If you really do want to "
"use the shell, you can add ``shell=True`` as a keyword argument and provide "
"a string instead of a sequence::"
msgstr ""
msgid ""
"The PEP takes various examples of shell and Python code and shows how they'd "
"be translated into Python code that uses :mod:`subprocess`. Reading this "
"section of the PEP is highly recommended."
msgstr ""
msgid ":pep:`324` - subprocess - New process module"
msgstr ""
msgid ""
"Written and implemented by Peter Åstrand, with assistance from Fredrik Lundh "
"and others."
msgstr ""
msgid "PEP 327: Decimal Data Type"
msgstr ""
msgid ""
"Python has always supported floating-point (FP) numbers, based on the "
"underlying C :c:expr:`double` type, as a data type. However, while most "
"programming languages provide a floating-point type, many people (even "
"programmers) are unaware that floating-point numbers don't represent certain "
"decimal fractions accurately. The new :class:`Decimal` type can represent "
"these fractions accurately, up to a user-specified precision limit."
msgstr ""
msgid "Why is Decimal needed?"
msgstr ""
msgid ""
"The limitations arise from the representation used for floating-point "
"numbers. FP numbers are made up of three components:"
msgstr ""
msgid "The sign, which is positive or negative."
msgstr ""
msgid ""
"The mantissa, which is a single-digit binary number followed by a "
"fractional part. For example, ``1.01`` in base-2 notation is ``1 + 0/2 + "
"1/4``, or 1.25 in decimal notation."
msgstr ""
msgid ""
"The exponent, which tells where the decimal point is located in the number "
"represented."
msgstr ""
msgid ""
"For example, the number 1.25 has positive sign, a mantissa value of 1.01 (in "
"binary), and an exponent of 0 (the decimal point doesn't need to be "
"shifted). The number 5 has the same sign and mantissa, but the exponent is 2 "
"because the mantissa is multiplied by 4 (2 to the power of the exponent 2); "
"1.25 \\* 4 equals 5."
msgstr ""
msgid ""
"Modern systems usually provide floating-point support that conforms to a "
"standard called IEEE 754. C's :c:expr:`double` type is usually implemented "
"as a 64-bit IEEE 754 number, which uses 52 bits of space for the mantissa. "
"This means that numbers can only be specified to 52 bits of precision. If "
"you're trying to represent numbers whose expansion repeats endlessly, the "
"expansion is cut off after 52 bits. Unfortunately, most software needs to "
"produce output in base 10, and common fractions in base 10 are often "
"repeating decimals in binary. For example, 1.1 decimal is binary "
"``1.0001100110011 ...``; .1 = 1/16 + 1/32 + 1/256 plus an infinite number of "
"additional terms. IEEE 754 has to chop off that infinitely repeated decimal "
"after 52 digits, so the representation is slightly inaccurate."
msgstr ""
msgid "Sometimes you can see this inaccuracy when the number is printed::"
msgstr ""
msgid ""
"The inaccuracy isn't always visible when you print the number because the FP-"
"to-decimal-string conversion is provided by the C library, and most C "
"libraries try to produce sensible output. Even if it's not displayed, "
"however, the inaccuracy is still there and subsequent operations can magnify "
"the error."
msgstr ""
msgid ""
"For many applications this doesn't matter. If I'm plotting points and "
"displaying them on my monitor, the difference between 1.1 and "
"1.1000000000000001 is too small to be visible. Reports often limit output "
"to a certain number of decimal places, and if you round the number to two or "
"three or even eight decimal places, the error is never apparent. However, "
"for applications where it does matter, it's a lot of work to implement your "
"own custom arithmetic routines."
msgstr ""
msgid "Hence, the :class:`Decimal` type was created."
msgstr ""
msgid "The :class:`Decimal` type"
msgstr ""
msgid ""
"A new module, :mod:`decimal`, was added to Python's standard library. It "
"contains two classes, :class:`Decimal` and :class:`Context`. :class:"
"`Decimal` instances represent numbers, and :class:`Context` instances are "
"used to wrap up various settings such as the precision and default rounding "
"mode."
msgstr ""
msgid ""
":class:`Decimal` instances are immutable, like regular Python integers and "
"FP numbers; once it's been created, you can't change the value an instance "
"represents. :class:`Decimal` instances can be created from integers or "
"strings::"
msgstr ""
msgid ""
"You can also provide tuples containing the sign, the mantissa represented "
"as a tuple of decimal digits, and the exponent::"
msgstr ""
msgid ""
"Cautionary note: the sign bit is a Boolean value, so 0 is positive and 1 is "
"negative."
msgstr ""
msgid ""
"Converting from floating-point numbers poses a bit of a problem: should the "
"FP number representing 1.1 turn into the decimal number for exactly 1.1, or "
"for 1.1 plus whatever inaccuracies are introduced? The decision was to dodge "
"the issue and leave such a conversion out of the API. Instead, you should "
"convert the floating-point number into a string using the desired precision "
"and pass the string to the :class:`Decimal` constructor::"
msgstr ""
msgid ""
"Once you have :class:`Decimal` instances, you can perform the usual "
"mathematical operations on them. One limitation: exponentiation requires an "
"integer exponent::"
msgstr ""
msgid ""
"You can combine :class:`Decimal` instances with integers, but not with "
"floating-point numbers::"
msgstr ""
msgid ""
":class:`Decimal` numbers can be used with the :mod:`math` and :mod:`cmath` "
"modules, but note that they'll be immediately converted to floating-point "
"numbers before the operation is performed, resulting in a possible loss of "
"precision and accuracy. You'll also get back a regular floating-point "
"number and not a :class:`Decimal`. ::"
msgstr ""
msgid ""
":class:`Decimal` instances have a :meth:`sqrt` method that returns a :class:"
"`Decimal`, but if you need other things such as trigonometric functions "
"you'll have to implement them. ::"
msgstr ""
msgid "The :class:`Context` type"
msgstr ""
msgid ""
"Instances of the :class:`Context` class encapsulate several settings for "
"decimal operations:"
msgstr ""
msgid ":attr:`prec` is the precision, the number of decimal places."
msgstr ""
msgid ""
":attr:`rounding` specifies the rounding mode. The :mod:`decimal` module has "
"constants for the various possibilities: :const:`ROUND_DOWN`, :const:"
"`ROUND_CEILING`, :const:`ROUND_HALF_EVEN`, and various others."
msgstr ""
msgid ""
":attr:`traps` is a dictionary specifying what happens on encountering "
"certain error conditions: either an exception is raised or a value is "
"returned. Some examples of error conditions are division by zero, loss of "
"precision, and overflow."
msgstr ""
msgid ""
"There's a thread-local default context available by calling :func:"
"`getcontext`; you can change the properties of this context to alter the "
"default precision, rounding, or trap handling. The following example shows "
"the effect of changing the precision of the default context::"
msgstr ""
msgid ""
"The default action for error conditions is selectable; the module can either "
"return a special value such as infinity or not-a-number, or exceptions can "
"be raised::"
msgstr ""
msgid ""
"The :class:`Context` instance also has various methods for formatting "
"numbers such as :meth:`to_eng_string` and :meth:`to_sci_string`."
msgstr ""
msgid ""
"For more information, see the documentation for the :mod:`decimal` module, "
"which includes a quick-start tutorial and a reference."
msgstr ""
msgid ":pep:`327` - Decimal Data Type"
msgstr ""
msgid ""
"Written by Facundo Batista and implemented by Facundo Batista, Eric Price, "
"Raymond Hettinger, Aahz, and Tim Peters."
msgstr ""
msgid "http://www.lahey.com/float.htm"
msgstr ""
msgid ""
"The article uses Fortran code to illustrate many of the problems that "
"floating-point inaccuracy can cause."
msgstr ""
msgid "http://speleotrove.com/decimal/"
msgstr ""
msgid ""
"A description of a decimal-based representation. This representation is "
"being proposed as a standard, and underlies the new Python decimal type. "
"Much of this material was written by Mike Cowlishaw, designer of the Rexx "
"language."
msgstr ""
msgid "PEP 328: Multi-line Imports"
msgstr ""
msgid ""
"One language change is a small syntactic tweak aimed at making it easier to "
"import many names from a module. In a ``from module import names`` "
"statement, *names* is a sequence of names separated by commas. If the "
"sequence is very long, you can either write multiple imports from the same "
"module, or you can use backslashes to escape the line endings like this::"
msgstr ""
msgid ""
"The syntactic change in Python 2.4 simply allows putting the names within "
"parentheses. Python ignores newlines within a parenthesized expression, so "
"the backslashes are no longer needed::"
msgstr ""
msgid ""
"The PEP also proposes that all :keyword:`import` statements be absolute "
"imports, with a leading ``.`` character to indicate a relative import. This "
"part of the PEP was not implemented for Python 2.4, but was completed for "
"Python 2.5."
msgstr ""
msgid ":pep:`328` - Imports: Multi-Line and Absolute/Relative"
msgstr ""
msgid "Written by Aahz. Multi-line imports were implemented by Dima Dorfman."
msgstr ""
msgid "PEP 331: Locale-Independent Float/String Conversions"
msgstr ""
msgid ""
"The :mod:`locale` modules lets Python software select various conversions "
"and display conventions that are localized to a particular country or "
"language. However, the module was careful to not change the numeric locale "
"because various functions in Python's implementation required that the "
"numeric locale remain set to the ``'C'`` locale. Often this was because the "
"code was using the C library's :c:func:`atof` function."
msgstr ""
msgid ""
"Not setting the numeric locale caused trouble for extensions that used third-"
"party C libraries, however, because they wouldn't have the correct locale "
"set. The motivating example was GTK+, whose user interface widgets weren't "
"displaying numbers in the current locale."
msgstr ""
msgid ""
"The solution described in the PEP is to add three new functions to the "
"Python API that perform ASCII-only conversions, ignoring the locale setting:"
msgstr ""
msgid ""
"``PyOS_ascii_strtod(str, ptr)`` and ``PyOS_ascii_atof(str, ptr)`` both "
"convert a string to a C :c:expr:`double`."
msgstr ""
msgid ""
"``PyOS_ascii_formatd(buffer, buf_len, format, d)`` converts a :c:expr:"
"`double` to an ASCII string."
msgstr ""
msgid ""
"The code for these functions came from the GLib library (https://developer-"
"old.gnome.org/glib/2.26/), whose developers kindly relicensed the relevant "
"functions and donated them to the Python Software Foundation. The :mod:"
"`locale` module can now change the numeric locale, letting extensions such "
"as GTK+ produce the correct results."
msgstr ""
msgid ":pep:`331` - Locale-Independent Float/String Conversions"
msgstr ""
msgid "Written by Christian R. Reis, and implemented by Gustavo Carneiro."
msgstr ""
msgid "Other Language Changes"
msgstr ""
msgid ""
"Here are all of the changes that Python 2.4 makes to the core Python "
"language."
msgstr ""
msgid "Decorators for functions and methods were added (:pep:`318`)."
msgstr ""
msgid ""
"Built-in :func:`set` and :func:`frozenset` types were added (:pep:`218`). "
"Other new built-ins include the ``reversed(seq)`` function (:pep:`322`)."
msgstr ""
msgid "Generator expressions were added (:pep:`289`)."
msgstr ""
msgid ""
"Certain numeric expressions no longer return values restricted to 32 or 64 "
"bits (:pep:`237`)."
msgstr ""
msgid ""
"You can now put parentheses around the list of names in a ``from module "
"import names`` statement (:pep:`328`)."
msgstr ""
msgid ""
"The :meth:`dict.update` method now accepts the same argument forms as the :"
"class:`dict` constructor. This includes any mapping, any iterable of key/"
"value pairs, and keyword arguments. (Contributed by Raymond Hettinger.)"
msgstr ""
msgid ""
"The string methods :meth:`ljust`, :meth:`rjust`, and :meth:`center` now take "
"an optional argument for specifying a fill character other than a space. "
"(Contributed by Raymond Hettinger.)"
msgstr ""
msgid ""
"Strings also gained an :meth:`rsplit` method that works like the :meth:"
"`split` method but splits from the end of the string. (Contributed by Sean "
"Reifschneider.) ::"
msgstr ""
msgid ""
"Three keyword parameters, *cmp*, *key*, and *reverse*, were added to the :"
"meth:`sort` method of lists. These parameters make some common usages of :"
"meth:`sort` simpler. All of these parameters are optional."
msgstr ""
msgid ""
"For the *cmp* parameter, the value should be a comparison function that "
"takes two parameters and returns -1, 0, or +1 depending on how the "
"parameters compare. This function will then be used to sort the list. "
"Previously this was the only parameter that could be provided to :meth:"
"`sort`."
msgstr ""
msgid ""
"*key* should be a single-parameter function that takes a list element and "
"returns a comparison key for the element. The list is then sorted using the "
"comparison keys. The following example sorts a list case-insensitively::"
msgstr ""
msgid ""
"The last example, which uses the *cmp* parameter, is the old way to perform "
"a case-insensitive sort. It works but is slower than using a *key* "
"parameter. Using *key* calls :meth:`lower` method once for each element in "
"the list while using *cmp* will call it twice for each comparison, so using "
"*key* saves on invocations of the :meth:`lower` method."
msgstr ""
msgid ""
"For simple key functions and comparison functions, it is often possible to "
"avoid a :keyword:`lambda` expression by using an unbound method instead. "
"For example, the above case-insensitive sort is best written as::"
msgstr ""
msgid ""
"Finally, the *reverse* parameter takes a Boolean value. If the value is "
"true, the list will be sorted into reverse order. Instead of ``L.sort(); L."
"reverse()``, you can now write ``L.sort(reverse=True)``."
msgstr ""
msgid ""
"The results of sorting are now guaranteed to be stable. This means that two "
"entries with equal keys will be returned in the same order as they were "
"input. For example, you can sort a list of people by name, and then sort the "
"list by age, resulting in a list sorted by age where people with the same "
"age are in name-sorted order."
msgstr ""
msgid "(All changes to :meth:`sort` contributed by Raymond Hettinger.)"
msgstr ""
msgid ""
"There is a new built-in function ``sorted(iterable)`` that works like the in-"
"place :meth:`list.sort` method but can be used in expressions. The "
"differences are:"
msgstr ""
msgid "the input may be any iterable;"
msgstr ""
msgid "a newly formed copy is sorted, leaving the original intact; and"
msgstr ""
msgid "the expression returns the new sorted copy"
msgstr ""
msgid "(Contributed by Raymond Hettinger.)"
msgstr ""
msgid ""
"Integer operations will no longer trigger an :exc:`OverflowWarning`. The :"
"exc:`OverflowWarning` warning will disappear in Python 2.5."
msgstr ""
msgid ""
"The interpreter gained a new switch, :option:`-m`, that takes a name, "
"searches for the corresponding module on ``sys.path``, and runs the module "
"as a script. For example, you can now run the Python profiler with ``python "
"-m profile``. (Contributed by Nick Coghlan.)"
msgstr ""
msgid ""
"The ``eval(expr, globals, locals)`` and ``execfile(filename, globals, "
"locals)`` functions and the ``exec`` statement now accept any mapping type "
"for the *locals* parameter. Previously this had to be a regular Python "
"dictionary. (Contributed by Raymond Hettinger.)"
msgstr ""
msgid ""
"The :func:`zip` built-in function and :func:`itertools.izip` now return an "
"empty list if called with no arguments. Previously they raised a :exc:"
"`TypeError` exception. This makes them more suitable for use with variable "
"length argument lists::"
msgstr ""
msgid ""
"Encountering a failure while importing a module no longer leaves a partially "
"initialized module object in ``sys.modules``. The incomplete module object "
"left behind would fool further imports of the same module into succeeding, "
"leading to confusing errors. (Fixed by Tim Peters.)"
msgstr ""
msgid ""
":const:`None` is now a constant; code that binds a new value to the name "
"``None`` is now a syntax error. (Contributed by Raymond Hettinger.)"
msgstr ""
msgid "Optimizations"
msgstr ""
msgid ""
"The inner loops for list and tuple slicing were optimized and now run about "
"one-third faster. The inner loops for dictionaries were also optimized, "
"resulting in performance boosts for :meth:`keys`, :meth:`values`, :meth:"
"`items`, :meth:`iterkeys`, :meth:`itervalues`, and :meth:`iteritems`. "
"(Contributed by Raymond Hettinger.)"
msgstr ""
msgid ""
"The machinery for growing and shrinking lists was optimized for speed and "
"for space efficiency. Appending and popping from lists now runs faster due "
"to more efficient code paths and less frequent use of the underlying system :"
"c:func:`realloc`. List comprehensions also benefit. :meth:`list.extend` "
"was also optimized and no longer converts its argument into a temporary list "
"before extending the base list. (Contributed by Raymond Hettinger.)"
msgstr ""
msgid ""
":func:`list`, :func:`tuple`, :func:`map`, :func:`filter`, and :func:`zip` "
"now run several times faster with non-sequence arguments that supply a :meth:"
"`__len__` method. (Contributed by Raymond Hettinger.)"
msgstr ""
msgid ""
"The methods :meth:`list.__getitem__`, :meth:`dict.__getitem__`, and :meth:"
"`dict.__contains__` are now implemented as :class:`method_descriptor` "
"objects rather than :class:`wrapper_descriptor` objects. This form of "
"access doubles their performance and makes them more suitable for use as "
"arguments to functionals: ``map(mydict.__getitem__, keylist)``. (Contributed "
"by Raymond Hettinger.)"
msgstr ""
msgid ""
"Added a new opcode, ``LIST_APPEND``, that simplifies the generated bytecode "
"for list comprehensions and speeds them up by about a third. (Contributed "
"by Raymond Hettinger.)"
msgstr ""
msgid ""
"The peephole bytecode optimizer has been improved to produce shorter, "
"faster bytecode; remarkably, the resulting bytecode is more readable. "
"(Enhanced by Raymond Hettinger.)"
msgstr ""
msgid ""
"String concatenations in statements of the form ``s = s + \"abc\"`` and ``s "
"+= \"abc\"`` are now performed more efficiently in certain circumstances. "
"This optimization won't be present in other Python implementations such as "
"Jython, so you shouldn't rely on it; using the :meth:`join` method of "
"strings is still recommended when you want to efficiently glue a large "
"number of strings together. (Contributed by Armin Rigo.)"
msgstr ""
msgid ""
"The net result of the 2.4 optimizations is that Python 2.4 runs the pystone "
"benchmark around 5% faster than Python 2.3 and 35% faster than Python 2.2. "
"(pystone is not a particularly good benchmark, but it's the most commonly "
"used measurement of Python's performance. Your own applications may show "
"greater or smaller benefits from Python 2.4.)"
msgstr ""
msgid "New, Improved, and Deprecated Modules"
msgstr ""
msgid ""
"As usual, Python's standard library received a number of enhancements and "
"bug fixes. Here's a partial list of the most notable changes, sorted "
"alphabetically by module name. Consult the :file:`Misc/NEWS` file in the "
"source tree for a more complete list of changes, or look through the CVS "
"logs for all the details."
msgstr ""
msgid ""
"The :mod:`asyncore` module's :func:`loop` function now has a *count* "
"parameter that lets you perform a limited number of passes through the "
"polling loop. The default is still to loop forever."
msgstr ""
msgid ""
"The :mod:`base64` module now has more complete :rfc:`3548` support for "
"Base64, Base32, and Base16 encoding and decoding, including optional case "
"folding and optional alternative alphabets. (Contributed by Barry Warsaw.)"
msgstr ""
msgid ""
"The :mod:`bisect` module now has an underlying C implementation for improved "
"performance. (Contributed by Dmitry Vasiliev.)"
msgstr ""
msgid ""
"The CJKCodecs collections of East Asian codecs, maintained by Hye-Shik "
"Chang, was integrated into 2.4. The new encodings are:"
msgstr ""
msgid "Chinese (PRC): gb2312, gbk, gb18030, big5hkscs, hz"
msgstr ""
msgid "Chinese (ROC): big5, cp950"
msgstr ""
msgid "Japanese: cp932, euc-jis-2004, euc-jp, euc-jisx0213, iso-2022-jp,"
msgstr ""
msgid ""
"iso-2022-jp-1, iso-2022-jp-2, iso-2022-jp-3, iso-2022-jp-ext, iso-2022-"
"jp-2004, shift-jis, shift-jisx0213, shift-jis-2004"
msgstr ""
msgid "Korean: cp949, euc-kr, johab, iso-2022-kr"