mirror of
https://github.com/python/cpython.git
synced 2025-11-09 01:51:26 +00:00
fix some typos (#138977)
This commit is contained in:
parent
a651ec9524
commit
6393068bde
4 changed files with 13 additions and 13 deletions
|
|
@ -205,7 +205,7 @@ ## Per-thread current task
|
||||||
found, `None` is returned.
|
found, `None` is returned.
|
||||||
|
|
||||||
In free-threading, it avoids contention on a global dictionary as
|
In free-threading, it avoids contention on a global dictionary as
|
||||||
threads can access the current task of thier running loop without any
|
threads can access the current task of their running loop without any
|
||||||
locking.
|
locking.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -4887,7 +4887,7 @@ class Color(Enum):
|
||||||
def _generate_next_value_(name, start, count, last):
|
def _generate_next_value_(name, start, count, last):
|
||||||
return name
|
return name
|
||||||
|
|
||||||
def test_auto_order_wierd(self):
|
def test_auto_order_weird(self):
|
||||||
weird_auto = auto()
|
weird_auto = auto()
|
||||||
weird_auto.value = 'pathological case'
|
weird_auto.value = 'pathological case'
|
||||||
class Color(Enum):
|
class Color(Enum):
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class FloatNum(float, Enum):
|
||||||
NEG_INF = float('-inf')
|
NEG_INF = float('-inf')
|
||||||
NAN = float('nan')
|
NAN = float('nan')
|
||||||
|
|
||||||
class WierdNum(float, Enum):
|
class WeirdNum(float, Enum):
|
||||||
inf = INF
|
inf = INF
|
||||||
neg_inf = NEG_INF
|
neg_inf = NEG_INF
|
||||||
nan = NAN
|
nan = NAN
|
||||||
|
|
@ -40,7 +40,7 @@ def test_floats(self):
|
||||||
self.assertEqual(self.loads(self.dumps(enum)), enum)
|
self.assertEqual(self.loads(self.dumps(enum)), enum)
|
||||||
|
|
||||||
def test_weird_floats(self):
|
def test_weird_floats(self):
|
||||||
for enum, expected in zip(WierdNum, ('Infinity', '-Infinity', 'NaN')):
|
for enum, expected in zip(WeirdNum, ('Infinity', '-Infinity', 'NaN')):
|
||||||
self.assertEqual(self.dumps(enum), expected)
|
self.assertEqual(self.dumps(enum), expected)
|
||||||
if not isnan(enum):
|
if not isnan(enum):
|
||||||
self.assertEqual(float(self.dumps(enum)), enum)
|
self.assertEqual(float(self.dumps(enum)), enum)
|
||||||
|
|
@ -64,16 +64,16 @@ def test_list(self):
|
||||||
str([E, PI, TAU]))
|
str([E, PI, TAU]))
|
||||||
self.assertEqual(self.loads(self.dumps(list(FloatNum))),
|
self.assertEqual(self.loads(self.dumps(list(FloatNum))),
|
||||||
list(FloatNum))
|
list(FloatNum))
|
||||||
self.assertEqual(self.dumps(list(WierdNum)),
|
self.assertEqual(self.dumps(list(WeirdNum)),
|
||||||
'[Infinity, -Infinity, NaN]')
|
'[Infinity, -Infinity, NaN]')
|
||||||
self.assertEqual(self.loads(self.dumps(list(WierdNum)))[:2],
|
self.assertEqual(self.loads(self.dumps(list(WeirdNum)))[:2],
|
||||||
list(WierdNum)[:2])
|
list(WeirdNum)[:2])
|
||||||
self.assertTrue(isnan(self.loads(self.dumps(list(WierdNum)))[2]))
|
self.assertTrue(isnan(self.loads(self.dumps(list(WeirdNum)))[2]))
|
||||||
|
|
||||||
def test_dict_keys(self):
|
def test_dict_keys(self):
|
||||||
s, b, h, r = BigNum
|
s, b, h, r = BigNum
|
||||||
e, p, t = FloatNum
|
e, p, t = FloatNum
|
||||||
i, j, n = WierdNum
|
i, j, n = WeirdNum
|
||||||
d = {
|
d = {
|
||||||
s:'tiny', b:'large', h:'larger', r:'largest',
|
s:'tiny', b:'large', h:'larger', r:'largest',
|
||||||
e:"Euler's number", p:'pi', t:'tau',
|
e:"Euler's number", p:'pi', t:'tau',
|
||||||
|
|
@ -100,9 +100,9 @@ def test_dict_values(self):
|
||||||
e=FloatNum.e,
|
e=FloatNum.e,
|
||||||
pi=FloatNum.pi,
|
pi=FloatNum.pi,
|
||||||
tau=FloatNum.tau,
|
tau=FloatNum.tau,
|
||||||
i=WierdNum.inf,
|
i=WeirdNum.inf,
|
||||||
j=WierdNum.neg_inf,
|
j=WeirdNum.neg_inf,
|
||||||
n=WierdNum.nan,
|
n=WeirdNum.nan,
|
||||||
)
|
)
|
||||||
nd = self.loads(self.dumps(d))
|
nd = self.loads(self.dumps(d))
|
||||||
self.assertEqual(nd['tiny'], SMALL)
|
self.assertEqual(nd['tiny'], SMALL)
|
||||||
|
|
|
||||||
|
|
@ -716,7 +716,7 @@ _zstd_ZstdCompressor_set_pledged_input_size_impl(ZstdCompressor *self,
|
||||||
unsigned long long size)
|
unsigned long long size)
|
||||||
/*[clinic end generated code: output=3a09e55cc0e3b4f9 input=b4c87bcbd5ce6111]*/
|
/*[clinic end generated code: output=3a09e55cc0e3b4f9 input=b4c87bcbd5ce6111]*/
|
||||||
{
|
{
|
||||||
// Error occured while converting argument, should be unreachable
|
// Error occurred while converting argument, should be unreachable
|
||||||
assert(size != ZSTD_CONTENTSIZE_ERROR);
|
assert(size != ZSTD_CONTENTSIZE_ERROR);
|
||||||
|
|
||||||
/* Thread-safe code */
|
/* Thread-safe code */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue