@@ -16,33 +16,33 @@ use typeob::PyTypeInfo;
16
16
/// Python object model helper methods
17
17
pub trait ObjectProtocol {
18
18
/// Determines whether this object has the given attribute.
19
- /// This is equivalent to the Python expression ' hasattr(self, attr_name)' .
19
+ /// This is equivalent to the Python expression ` hasattr(self, attr_name)` .
20
20
fn hasattr < N > ( & self , attr_name : N ) -> PyResult < bool >
21
21
where
22
22
N : ToPyObject ;
23
23
24
24
/// Retrieves an attribute value.
25
- /// This is equivalent to the Python expression ' self.attr_name' .
25
+ /// This is equivalent to the Python expression ` self.attr_name` .
26
26
fn getattr < N > ( & self , attr_name : N ) -> PyResult < & PyObjectRef >
27
27
where
28
28
N : ToPyObject ;
29
29
30
30
/// Sets an attribute value.
31
- /// This is equivalent to the Python expression ' self.attr_name = value' .
31
+ /// This is equivalent to the Python expression ` self.attr_name = value` .
32
32
fn setattr < N , V > ( & self , attr_name : N , value : V ) -> PyResult < ( ) >
33
33
where
34
34
N : ToBorrowedObject ,
35
35
V : ToBorrowedObject ;
36
36
37
37
/// Deletes an attribute.
38
- /// This is equivalent to the Python expression ' del self.attr_name' .
38
+ /// This is equivalent to the Python expression ` del self.attr_name` .
39
39
fn delattr < N > ( & self , attr_name : N ) -> PyResult < ( ) >
40
40
where
41
41
N : ToPyObject ;
42
42
43
43
/// Compares two Python objects.
44
44
///
45
- /// On Python 2, this is equivalent to the Python expression ' cmp(self, other)' .
45
+ /// On Python 2, this is equivalent to the Python expression ` cmp(self, other)` .
46
46
///
47
47
/// On Python 3, this is equivalent to:
48
48
/// ```python,ignore
@@ -73,35 +73,35 @@ pub trait ObjectProtocol {
73
73
O : ToPyObject ;
74
74
75
75
/// Compute the string representation of self.
76
- /// This is equivalent to the Python expression ' repr(self)' .
76
+ /// This is equivalent to the Python expression ` repr(self)` .
77
77
fn repr ( & self ) -> PyResult < & PyString > ;
78
78
79
79
/// Compute the string representation of self.
80
- /// This is equivalent to the Python expression ' str(self)' .
80
+ /// This is equivalent to the Python expression ` str(self)` .
81
81
fn str ( & self ) -> PyResult < & PyString > ;
82
82
83
83
/// Determines whether this object is callable.
84
84
fn is_callable ( & self ) -> bool ;
85
85
86
86
/// Calls the object.
87
- /// This is equivalent to the Python expression: ' self(*args, **kwargs)'
87
+ /// This is equivalent to the Python expression: ` self(*args, **kwargs)`
88
88
fn call < A , K > ( & self , args : A , kwargs : K ) -> PyResult < & PyObjectRef >
89
89
where
90
90
A : IntoPyTuple ,
91
91
K : IntoPyDictPointer ;
92
92
93
93
/// Calls the object.
94
- /// This is equivalent to the Python expression: ' self()'
94
+ /// This is equivalent to the Python expression: ` self()`
95
95
fn call0 ( & self ) -> PyResult < & PyObjectRef > ;
96
96
97
97
/// Calls the object.
98
- /// This is equivalent to the Python expression: ' self(*args)'
98
+ /// This is equivalent to the Python expression: ` self(*args)`
99
99
fn call1 < A > ( & self , args : A ) -> PyResult < & PyObjectRef >
100
100
where
101
101
A : IntoPyTuple ;
102
102
103
103
/// Calls a method on the object.
104
- /// This is equivalent to the Python expression: ' self.name(*args, **kwargs)'
104
+ /// This is equivalent to the Python expression: ` self.name(*args, **kwargs)`
105
105
///
106
106
/// # Example
107
107
/// ```rust,ignore
@@ -116,43 +116,43 @@ pub trait ObjectProtocol {
116
116
K : IntoPyDictPointer ;
117
117
118
118
/// Calls a method on the object.
119
- /// This is equivalent to the Python expression: ' self.name()'
119
+ /// This is equivalent to the Python expression: ` self.name()`
120
120
fn call_method0 ( & self , name : & str ) -> PyResult < & PyObjectRef > ;
121
121
122
122
/// Calls a method on the object with positional arguments only .
123
- /// This is equivalent to the Python expression: ' self.name(*args)'
123
+ /// This is equivalent to the Python expression: ` self.name(*args)`
124
124
fn call_method1 < A : IntoPyTuple > ( & self , name : & str , args : A ) -> PyResult < & PyObjectRef > ;
125
125
126
126
/// Retrieves the hash code of the object.
127
- /// This is equivalent to the Python expression: ' hash(self)'
127
+ /// This is equivalent to the Python expression: ` hash(self)`
128
128
fn hash ( & self ) -> PyResult < isize > ;
129
129
130
130
/// Returns whether the object is considered to be true.
131
- /// This is equivalent to the Python expression: ' not not self'
131
+ /// This is equivalent to the Python expression: ` not not self`
132
132
fn is_true ( & self ) -> PyResult < bool > ;
133
133
134
134
/// Returns whether the object is considered to be None.
135
- /// This is equivalent to the Python expression: ' is None'
135
+ /// This is equivalent to the Python expression: ` is None`
136
136
fn is_none ( & self ) -> bool ;
137
137
138
138
/// Returns the length of the sequence or mapping.
139
- /// This is equivalent to the Python expression: ' len(self)'
139
+ /// This is equivalent to the Python expression: ` len(self)`
140
140
fn len ( & self ) -> PyResult < usize > ;
141
141
142
- /// This is equivalent to the Python expression: ' self[key]'
142
+ /// This is equivalent to the Python expression: ` self[key]`
143
143
fn get_item < K > ( & self , key : K ) -> PyResult < & PyObjectRef >
144
144
where
145
145
K : ToBorrowedObject ;
146
146
147
147
/// Sets an item value.
148
- /// This is equivalent to the Python expression ' self[key] = value' .
148
+ /// This is equivalent to the Python expression ` self[key] = value` .
149
149
fn set_item < K , V > ( & self , key : K , value : V ) -> PyResult < ( ) >
150
150
where
151
151
K : ToBorrowedObject ,
152
152
V : ToBorrowedObject ;
153
153
154
154
/// Deletes an item.
155
- /// This is equivalent to the Python expression ' del self[key]' .
155
+ /// This is equivalent to the Python expression ` del self[key]` .
156
156
fn del_item < K > ( & self , key : K ) -> PyResult < ( ) >
157
157
where
158
158
K : ToBorrowedObject ;
0 commit comments