Skip to content

Commit e167670

Browse files
committed
Add / for decimal.Context methods docs
1 parent c2ac662 commit e167670

File tree

1 file changed

+59
-59
lines changed

1 file changed

+59
-59
lines changed

Doc/library/decimal.rst

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,11 +1146,11 @@ In addition to the three supplied contexts, new contexts can be created with the
11461146

11471147
Return a duplicate of the context.
11481148

1149-
.. method:: copy_decimal(num)
1149+
.. method:: copy_decimal(num, /)
11501150

11511151
Return a copy of the Decimal instance num.
11521152

1153-
.. method:: create_decimal(num)
1153+
.. method:: create_decimal(num='0', /)
11541154

11551155
Creates a new Decimal instance from *num* but using *self* as
11561156
context. Unlike the :class:`Decimal` constructor, the context precision,
@@ -1174,7 +1174,7 @@ In addition to the three supplied contexts, new contexts can be created with the
11741174
If the argument is a string, no leading or trailing whitespace or
11751175
underscores are permitted.
11761176

1177-
.. method:: create_decimal_from_float(f)
1177+
.. method:: create_decimal_from_float(f, /)
11781178

11791179
Creates a new Decimal instance from a float *f* but rounding using *self*
11801180
as the context. Unlike the :meth:`Decimal.from_float` class method,
@@ -1212,222 +1212,222 @@ In addition to the three supplied contexts, new contexts can be created with the
12121212
recounted here.
12131213

12141214

1215-
.. method:: abs(x)
1215+
.. method:: abs(x, /)
12161216

12171217
Returns the absolute value of *x*.
12181218

12191219

1220-
.. method:: add(x, y)
1220+
.. method:: add(x, y, /)
12211221

12221222
Return the sum of *x* and *y*.
12231223

12241224

1225-
.. method:: canonical(x)
1225+
.. method:: canonical(x, /)
12261226

12271227
Returns the same Decimal object *x*.
12281228

12291229

1230-
.. method:: compare(x, y)
1230+
.. method:: compare(x, y, /)
12311231

12321232
Compares *x* and *y* numerically.
12331233

12341234

1235-
.. method:: compare_signal(x, y)
1235+
.. method:: compare_signal(x, y, /)
12361236

12371237
Compares the values of the two operands numerically.
12381238

12391239

1240-
.. method:: compare_total(x, y)
1240+
.. method:: compare_total(x, y, /)
12411241

12421242
Compares two operands using their abstract representation.
12431243

12441244

1245-
.. method:: compare_total_mag(x, y)
1245+
.. method:: compare_total_mag(x, y, /)
12461246

12471247
Compares two operands using their abstract representation, ignoring sign.
12481248

12491249

1250-
.. method:: copy_abs(x)
1250+
.. method:: copy_abs(x, /)
12511251

12521252
Returns a copy of *x* with the sign set to 0.
12531253

12541254

1255-
.. method:: copy_negate(x)
1255+
.. method:: copy_negate(x, /)
12561256

12571257
Returns a copy of *x* with the sign inverted.
12581258

12591259

1260-
.. method:: copy_sign(x, y)
1260+
.. method:: copy_sign(x, y, /)
12611261

12621262
Copies the sign from *y* to *x*.
12631263

12641264

1265-
.. method:: divide(x, y)
1265+
.. method:: divide(x, y, /)
12661266

12671267
Return *x* divided by *y*.
12681268

12691269

1270-
.. method:: divide_int(x, y)
1270+
.. method:: divide_int(x, y, /)
12711271

12721272
Return *x* divided by *y*, truncated to an integer.
12731273

12741274

1275-
.. method:: divmod(x, y)
1275+
.. method:: divmod(x, y, /)
12761276

12771277
Divides two numbers and returns the integer part of the result.
12781278

12791279

1280-
.. method:: exp(x)
1280+
.. method:: exp(x, /)
12811281

12821282
Returns ``e ** x``.
12831283

12841284

1285-
.. method:: fma(x, y, z)
1285+
.. method:: fma(x, y, z, /)
12861286

12871287
Returns *x* multiplied by *y*, plus *z*.
12881288

12891289

1290-
.. method:: is_canonical(x)
1290+
.. method:: is_canonical(x, /)
12911291

12921292
Returns ``True`` if *x* is canonical; otherwise returns ``False``.
12931293

12941294

1295-
.. method:: is_finite(x)
1295+
.. method:: is_finite(x, /)
12961296

12971297
Returns ``True`` if *x* is finite; otherwise returns ``False``.
12981298

12991299

1300-
.. method:: is_infinite(x)
1300+
.. method:: is_infinite(x, /)
13011301

13021302
Returns ``True`` if *x* is infinite; otherwise returns ``False``.
13031303

13041304

1305-
.. method:: is_nan(x)
1305+
.. method:: is_nan(x, /)
13061306

13071307
Returns ``True`` if *x* is a qNaN or sNaN; otherwise returns ``False``.
13081308

13091309

1310-
.. method:: is_normal(x)
1310+
.. method:: is_normal(x, /)
13111311

13121312
Returns ``True`` if *x* is a normal number; otherwise returns ``False``.
13131313

13141314

1315-
.. method:: is_qnan(x)
1315+
.. method:: is_qnan(x, /)
13161316

13171317
Returns ``True`` if *x* is a quiet NaN; otherwise returns ``False``.
13181318

13191319

1320-
.. method:: is_signed(x)
1320+
.. method:: is_signed(x, /)
13211321

13221322
Returns ``True`` if *x* is negative; otherwise returns ``False``.
13231323

13241324

1325-
.. method:: is_snan(x)
1325+
.. method:: is_snan(x, /)
13261326

13271327
Returns ``True`` if *x* is a signaling NaN; otherwise returns ``False``.
13281328

13291329

1330-
.. method:: is_subnormal(x)
1330+
.. method:: is_subnormal(x, /)
13311331

13321332
Returns ``True`` if *x* is subnormal; otherwise returns ``False``.
13331333

13341334

1335-
.. method:: is_zero(x)
1335+
.. method:: is_zero(x, /)
13361336

13371337
Returns ``True`` if *x* is a zero; otherwise returns ``False``.
13381338

13391339

1340-
.. method:: ln(x)
1340+
.. method:: ln(x, /)
13411341

13421342
Returns the natural (base e) logarithm of *x*.
13431343

13441344

1345-
.. method:: log10(x)
1345+
.. method:: log10(x, /)
13461346

13471347
Returns the base 10 logarithm of *x*.
13481348

13491349

1350-
.. method:: logb(x)
1350+
.. method:: logb(x, /)
13511351

13521352
Returns the exponent of the magnitude of the operand's MSD.
13531353

13541354

1355-
.. method:: logical_and(x, y)
1355+
.. method:: logical_and(x, y, /)
13561356

13571357
Applies the logical operation *and* between each operand's digits.
13581358

13591359

1360-
.. method:: logical_invert(x)
1360+
.. method:: logical_invert(x, /)
13611361

13621362
Invert all the digits in *x*.
13631363

13641364

1365-
.. method:: logical_or(x, y)
1365+
.. method:: logical_or(x, y, /)
13661366

13671367
Applies the logical operation *or* between each operand's digits.
13681368

13691369

1370-
.. method:: logical_xor(x, y)
1370+
.. method:: logical_xor(x, y, /)
13711371

13721372
Applies the logical operation *xor* between each operand's digits.
13731373

13741374

1375-
.. method:: max(x, y)
1375+
.. method:: max(x, y, /)
13761376

13771377
Compares two values numerically and returns the maximum.
13781378

13791379

1380-
.. method:: max_mag(x, y)
1380+
.. method:: max_mag(x, y, /)
13811381

13821382
Compares the values numerically with their sign ignored.
13831383

13841384

1385-
.. method:: min(x, y)
1385+
.. method:: min(x, y, /)
13861386

13871387
Compares two values numerically and returns the minimum.
13881388

13891389

1390-
.. method:: min_mag(x, y)
1390+
.. method:: min_mag(x, y, /)
13911391

13921392
Compares the values numerically with their sign ignored.
13931393

13941394

1395-
.. method:: minus(x)
1395+
.. method:: minus(x, /)
13961396

13971397
Minus corresponds to the unary prefix minus operator in Python.
13981398

13991399

1400-
.. method:: multiply(x, y)
1400+
.. method:: multiply(x, y, /)
14011401

14021402
Return the product of *x* and *y*.
14031403

14041404

1405-
.. method:: next_minus(x)
1405+
.. method:: next_minus(x, /)
14061406

14071407
Returns the largest representable number smaller than *x*.
14081408

14091409

1410-
.. method:: next_plus(x)
1410+
.. method:: next_plus(x, /)
14111411

14121412
Returns the smallest representable number larger than *x*.
14131413

14141414

1415-
.. method:: next_toward(x, y)
1415+
.. method:: next_toward(x, y, /)
14161416

14171417
Returns the number closest to *x*, in direction towards *y*.
14181418

14191419

1420-
.. method:: normalize(x)
1420+
.. method:: normalize(x, /)
14211421

14221422
Reduces *x* to its simplest form.
14231423

14241424

1425-
.. method:: number_class(x)
1425+
.. method:: number_class(x, /)
14261426

14271427
Returns an indication of the class of *x*.
14281428

14291429

1430-
.. method:: plus(x)
1430+
.. method:: plus(x, /)
14311431

14321432
Plus corresponds to the unary prefix plus operator in Python. This
14331433
operation applies the context precision and rounding, so it is *not* an
@@ -1468,7 +1468,7 @@ In addition to the three supplied contexts, new contexts can be created with the
14681468
always exact.
14691469

14701470

1471-
.. method:: quantize(x, y)
1471+
.. method:: quantize(x, y, /)
14721472

14731473
Returns a value equal to *x* (rounded), having the exponent of *y*.
14741474

@@ -1478,51 +1478,51 @@ In addition to the three supplied contexts, new contexts can be created with the
14781478
Just returns 10, as this is Decimal, :)
14791479

14801480

1481-
.. method:: remainder(x, y)
1481+
.. method:: remainder(x, y, /)
14821482

14831483
Returns the remainder from integer division.
14841484

14851485
The sign of the result, if non-zero, is the same as that of the original
14861486
dividend.
14871487

14881488

1489-
.. method:: remainder_near(x, y)
1489+
.. method:: remainder_near(x, y, /)
14901490

14911491
Returns ``x - y * n``, where *n* is the integer nearest the exact value
14921492
of ``x / y`` (if the result is 0 then its sign will be the sign of *x*).
14931493

14941494

1495-
.. method:: rotate(x, y)
1495+
.. method:: rotate(x, y, /)
14961496

14971497
Returns a rotated copy of *x*, *y* times.
14981498

14991499

1500-
.. method:: same_quantum(x, y)
1500+
.. method:: same_quantum(x, y, /)
15011501

15021502
Returns ``True`` if the two operands have the same exponent.
15031503

15041504

1505-
.. method:: scaleb (x, y)
1505+
.. method:: scaleb (x, y, /)
15061506

15071507
Returns the first operand after adding the second value its exp.
15081508

15091509

1510-
.. method:: shift(x, y)
1510+
.. method:: shift(x, y, /)
15111511

15121512
Returns a shifted copy of *x*, *y* times.
15131513

15141514

1515-
.. method:: sqrt(x)
1515+
.. method:: sqrt(x, /)
15161516

15171517
Square root of a non-negative number to context precision.
15181518

15191519

1520-
.. method:: subtract(x, y)
1520+
.. method:: subtract(x, y, /)
15211521

15221522
Return the difference between *x* and *y*.
15231523

15241524

1525-
.. method:: to_eng_string(x)
1525+
.. method:: to_eng_string(x, /)
15261526

15271527
Convert to a string, using engineering notation if an exponent is needed.
15281528

@@ -1531,12 +1531,12 @@ In addition to the three supplied contexts, new contexts can be created with the
15311531
require the addition of either one or two trailing zeros.
15321532

15331533

1534-
.. method:: to_integral_exact(x)
1534+
.. method:: to_integral_exact(x, /)
15351535

15361536
Rounds to an integer.
15371537

15381538

1539-
.. method:: to_sci_string(x)
1539+
.. method:: to_sci_string(x, /)
15401540

15411541
Converts a number to a string using scientific notation.
15421542

0 commit comments

Comments
 (0)