mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
Eliminate ctx.set_attr.
This commit is contained in:
@@ -43,8 +43,6 @@ impl PyValue for PyBytes {
|
||||
|
||||
// Fill bytes class methods:
|
||||
pub fn init(context: &PyContext) {
|
||||
let bytes_type = context.bytes_type.as_object();
|
||||
|
||||
let bytes_doc =
|
||||
"bytes(iterable_of_ints) -> bytes\n\
|
||||
bytes(string, encoding[, errors]) -> bytes\n\
|
||||
@@ -56,7 +54,7 @@ pub fn init(context: &PyContext) {
|
||||
- any object implementing the buffer API.\n \
|
||||
- an integer";
|
||||
|
||||
extend_class!(context, bytes_type, {
|
||||
extend_class!(context, &context.bytes_type, {
|
||||
"__new__" => context.new_rustfunc(bytes_new),
|
||||
"__eq__" => context.new_rustfunc(PyBytesRef::eq),
|
||||
"__lt__" => context.new_rustfunc(PyBytesRef::lt),
|
||||
|
||||
Reference in New Issue
Block a user