Skip to content

Commit 00dc025

Browse files
authored
Merge pull request RustPython#4228 from gilteunchoi/remove-old-doc-remark
remove most of old __doc__ remarks
2 parents 425895d + 227034d commit 00dc025

File tree

19 files changed

+2
-266
lines changed

19 files changed

+2
-266
lines changed

stdlib/src/bisect.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ mod _bisect {
5757
Ok((lo, hi))
5858
}
5959

60-
/// Return the index where to insert item x in list a, assuming a is sorted.
61-
///
62-
/// The return value i is such that all e in a[:i] have e < x, and all e in
63-
/// a[i:] have e >= x. So if x already appears in the list, a.insert(x) will
64-
/// insert just before the leftmost x already there.
65-
///
66-
/// Optional args lo (default 0) and hi (default len(a)) bound the
67-
/// slice of a to be searched.
6860
#[inline]
6961
#[pyfunction]
7062
fn bisect_left(
@@ -91,14 +83,6 @@ mod _bisect {
9183
Ok(lo)
9284
}
9385

94-
/// Return the index where to insert item x in list a, assuming a is sorted.
95-
///
96-
/// The return value i is such that all e in a[:i] have e <= x, and all e in
97-
/// a[i:] have e > x. So if x already appears in the list, a.insert(x) will
98-
/// insert just after the rightmost x already there.
99-
///
100-
/// Optional args lo (default 0) and hi (default len(a)) bound the
101-
/// slice of a to be searched.
10286
#[inline]
10387
#[pyfunction]
10488
fn bisect_right(
@@ -125,12 +109,6 @@ mod _bisect {
125109
Ok(lo)
126110
}
127111

128-
/// Insert item x in list a, and keep it sorted assuming a is sorted.
129-
///
130-
/// If x is already in a, insert it to the left of the leftmost x.
131-
///
132-
/// Optional args lo (default 0) and hi (default len(a)) bound the
133-
/// slice of a to be searched.
134112
#[pyfunction]
135113
fn insort_left(BisectArgs { a, x, lo, hi, key }: BisectArgs, vm: &VirtualMachine) -> PyResult {
136114
let x = if let Some(ref key) = key {
@@ -151,12 +129,6 @@ mod _bisect {
151129
vm.call_method(&a, "insert", (index, x))
152130
}
153131

154-
/// Insert item x in list a, and keep it sorted assuming a is sorted.
155-
///
156-
/// If x is already in a, insert it to the right of the rightmost x.
157-
///
158-
/// Optional args lo (default 0) and hi (default len(a)) bound the
159-
/// slice of a to be searched
160132
#[pyfunction]
161133
fn insort_right(BisectArgs { a, x, lo, hi, key }: BisectArgs, vm: &VirtualMachine) -> PyResult {
162134
let x = if let Some(ref key) = key {

stdlib/src/cmath.rs

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// TODO: Keep track of rust-num/num-complex/issues/2. A common trait could help with duplication
22
// that exists between cmath and math.
33
pub(crate) use cmath::make_module;
4-
5-
/// This module provides access to mathematical functions for complex numbers.
64
#[pymodule]
75
mod cmath {
86
use crate::vm::{
@@ -21,57 +19,48 @@ mod cmath {
2119
#[pyattr(name = "nanj")]
2220
const NANJ: Complex64 = Complex64::new(0., std::f64::NAN);
2321

24-
/// Return argument, also known as the phase angle, of a complex.
2522
#[pyfunction]
2623
fn phase(z: ArgIntoComplex) -> f64 {
2724
z.arg()
2825
}
2926

30-
/// Convert a complex from rectangular coordinates to polar coordinates.
31-
///
32-
/// r is the distance from 0 and phi the phase angle.
3327
#[pyfunction]
3428
fn polar(x: ArgIntoComplex) -> (f64, f64) {
3529
x.to_polar()
3630
}
3731

38-
/// Convert from polar coordinates to rectangular coordinates.
3932
#[pyfunction]
4033
fn rect(r: ArgIntoFloat, phi: ArgIntoFloat) -> Complex64 {
4134
Complex64::from_polar(*r, *phi)
4235
}
4336

44-
/// Checks if the real or imaginary part of z is infinite.
4537
#[pyfunction]
4638
fn isinf(z: ArgIntoComplex) -> bool {
4739
let Complex64 { re, im } = *z;
4840
re.is_infinite() || im.is_infinite()
4941
}
5042

51-
/// Return True if both the real and imaginary parts of z are finite, else False.
5243
#[pyfunction]
5344
fn isfinite(z: ArgIntoComplex) -> bool {
5445
z.is_finite()
5546
}
5647

57-
/// Checks if the real or imaginary part of z not a number (NaN)..
5848
#[pyfunction]
5949
fn isnan(z: ArgIntoComplex) -> bool {
6050
z.is_nan()
6151
}
6252

63-
/// Return the exponential value e**z.
6453
#[pyfunction]
6554
fn exp(z: ArgIntoComplex, vm: &VirtualMachine) -> PyResult<Complex64> {
6655
let z = *z;
6756
result_or_overflow(z, z.exp(), vm)
6857
}
69-
/// Return the square root of z.
58+
7059
#[pyfunction]
7160
fn sqrt(z: ArgIntoComplex) -> Complex64 {
7261
z.sqrt()
7362
}
74-
/// Return the sine of z
63+
7564
#[pyfunction]
7665
fn sin(z: ArgIntoComplex) -> Complex64 {
7766
z.sin()
@@ -82,7 +71,6 @@ mod cmath {
8271
z.asin()
8372
}
8473

85-
/// Return the cosine of z
8674
#[pyfunction]
8775
fn cos(z: ArgIntoComplex) -> Complex64 {
8876
z.cos()
@@ -93,9 +81,6 @@ mod cmath {
9381
z.acos()
9482
}
9583

96-
/// log(z[, base]) -> the logarithm of z to the given base.
97-
///
98-
/// If the base not specified, returns the natural logarithm (base e) of z.
9984
#[pyfunction]
10085
fn log(z: ArgIntoComplex, base: OptionalArg<ArgIntoComplex>) -> Complex64 {
10186
// TODO: Complex64.log with a negative base yields wrong results.
@@ -110,55 +95,46 @@ mod cmath {
11095
)
11196
}
11297

113-
/// Return the base-10 logarithm of z.
11498
#[pyfunction]
11599
fn log10(z: ArgIntoComplex) -> Complex64 {
116100
z.log(10.0)
117101
}
118102

119-
/// Return the inverse hyperbolic cosine of z.
120103
#[pyfunction]
121104
fn acosh(z: ArgIntoComplex) -> Complex64 {
122105
z.acosh()
123106
}
124107

125-
/// Return the inverse tangent of z.
126108
#[pyfunction]
127109
fn atan(z: ArgIntoComplex) -> Complex64 {
128110
z.atan()
129111
}
130112

131-
/// Return the inverse hyperbolic tangent of z.
132113
#[pyfunction]
133114
fn atanh(z: ArgIntoComplex) -> Complex64 {
134115
z.atanh()
135116
}
136117

137-
/// Return the tangent of z.
138118
#[pyfunction]
139119
fn tan(z: ArgIntoComplex) -> Complex64 {
140120
z.tan()
141121
}
142122

143-
/// Return the hyperbolic tangent of z.
144123
#[pyfunction]
145124
fn tanh(z: ArgIntoComplex) -> Complex64 {
146125
z.tanh()
147126
}
148127

149-
/// Return the hyperbolic sin of z.
150128
#[pyfunction]
151129
fn sinh(z: ArgIntoComplex) -> Complex64 {
152130
z.sinh()
153131
}
154132

155-
/// Return the hyperbolic cosine of z.
156133
#[pyfunction]
157134
fn cosh(z: ArgIntoComplex) -> Complex64 {
158135
z.cosh()
159136
}
160137

161-
/// Return the inverse hyperbolic sine of z.
162138
#[pyfunction]
163139
fn asinh(z: ArgIntoComplex) -> Complex64 {
164140
z.asinh()
@@ -176,22 +152,6 @@ mod cmath {
176152
abs_tol: OptionalArg<ArgIntoFloat>,
177153
}
178154

179-
/// Determine whether two complex numbers are close in value.
180-
///
181-
/// rel_tol
182-
/// maximum difference for being considered "close", relative to the
183-
/// magnitude of the input values
184-
/// abs_tol
185-
/// maximum difference for being considered "close", regardless of the
186-
/// magnitude of the input values
187-
///
188-
/// Return True if a is close in value to b, and False otherwise.
189-
///
190-
/// For the values to be considered close, the difference between them must be
191-
/// smaller than at least one of the tolerances.
192-
///
193-
/// -inf, inf and NaN behave similarly to the IEEE 754 Standard. That is, NaN is
194-
/// not close to anything, even itself. inf and -inf are only close to themselves.
195155
#[pyfunction]
196156
fn isclose(args: IsCloseArgs, vm: &VirtualMachine) -> PyResult<bool> {
197157
let a = *args.a;

stdlib/src/zlib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ mod zlib {
6262
)
6363
}
6464

65-
/// Compute an Adler-32 checksum of data.
6665
#[pyfunction]
6766
fn adler32(data: ArgBytesLike, begin_state: OptionalArg<PyIntRef>) -> u32 {
6867
data.with_ref(|data| {
@@ -74,7 +73,6 @@ mod zlib {
7473
})
7574
}
7675

77-
/// Compute a CRC-32 checksum of data.
7876
#[pyfunction]
7977
fn crc32(data: ArgBytesLike, begin_state: OptionalArg<PyIntRef>) -> u32 {
8078
crate::binascii::crc32(data, begin_state)

vm/src/builtins/bool.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ impl PyObjectRef {
7171
}
7272
}
7373

74-
/// bool(x) -> bool
75-
///
76-
/// Returns True when the argument x is true, False otherwise.
77-
/// The builtins True and False are the only two instances of the class bool.
78-
/// The class bool is a subclass of the class int, and cannot be subclassed.
7974
#[pyclass(name = "bool", module = false, base = "PyInt")]
8075
pub struct PyBool;
8176

vm/src/builtins/dict.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ use std::fmt;
3131

3232
pub type DictContentType = dictdatatype::Dict;
3333

34-
/// dict() -> new empty dictionary
35-
/// dict(mapping) -> new dictionary initialized from a mapping object's
36-
/// (key, value) pairs
37-
/// dict(iterable) -> new dictionary initialized as if via:
38-
/// d = {}
39-
/// for k, v in iterable:
40-
/// d\[k\] = v
41-
/// dict(**kwargs) -> new dictionary initialized with the name=value pairs
42-
/// in the keyword argument list. For example: dict(one=1, two=2)
4334
#[pyclass(module = false, name = "dict")]
4435
#[derive(Default)]
4536
pub struct PyDict {

vm/src/builtins/filter.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ use crate::{
66
Context, Py, PyObjectRef, PyPayload, PyResult, VirtualMachine,
77
};
88

9-
/// filter(function or None, iterable) --> filter object
10-
///
11-
/// Return an iterator yielding those items of iterable for which function(item)
12-
/// is true. If function is None, return the items that are true.
139
#[pyclass(module = false, name = "filter")]
1410
#[derive(Debug)]
1511
pub struct PyFilter {

vm/src/builtins/float.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use num_complex::Complex64;
2222
use num_rational::Ratio;
2323
use num_traits::{Signed, ToPrimitive, Zero};
2424

25-
/// Convert a string or number to a floating point number, if possible.
2625
#[pyclass(module = false, name = "float")]
2726
#[derive(Debug, Copy, Clone, PartialEq)]
2827
pub struct PyFloat {

vm/src/builtins/int.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,6 @@ use num_traits::{One, Pow, PrimInt, Signed, ToPrimitive, Zero};
2323
use std::ops::{Div, Neg};
2424
use std::{fmt, ops::Not};
2525

26-
/// int(x=0) -> integer
27-
/// int(x, base=10) -> integer
28-
///
29-
/// Convert a number or string to an integer, or return 0 if no arguments
30-
/// are given. If x is a number, return x.__int__(). For floating point
31-
/// numbers, this truncates towards zero.
32-
///
33-
/// If x is not a number or if base is given, then x must be a string,
34-
/// bytes, or bytearray instance representing an integer literal in the
35-
/// given base. The literal can be preceded by '+' or '-' and be surrounded
36-
/// by whitespace. The base defaults to 10. Valid bases are 0 and 2-36.
37-
/// Base 0 means to interpret the base from the string as an integer literal.
38-
/// >>> int('0b100', base=0)
39-
/// 4
4026
#[pyclass(module = false, name = "int")]
4127
#[derive(Debug)]
4228
pub struct PyInt {

vm/src/builtins/list.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ use crate::{
2222
};
2323
use std::{fmt, ops::DerefMut};
2424

25-
/// Built-in mutable sequence.
26-
///
27-
/// If no argument is given, the constructor creates a new empty list.
28-
/// The argument must be an iterable if specified.
2925
#[pyclass(module = false, name = "list")]
3026
#[derive(Default)]
3127
pub struct PyList {

vm/src/builtins/map.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ use crate::{
88
Context, Py, PyObjectRef, PyPayload, PyResult, VirtualMachine,
99
};
1010

11-
/// map(func, *iterables) --> map object
12-
///
13-
/// Make an iterator that computes the function using arguments from
14-
/// each of the iterables. Stops when the shortest iterable is exhausted.
1511
#[pyclass(module = false, name = "map")]
1612
#[derive(Debug)]
1713
pub struct PyMap {

0 commit comments

Comments
 (0)