Eliminate ctx.set_attr.

This commit is contained in:
Adam Kelly
2019-04-04 14:49:10 +01:00
parent 25c17b4829
commit c8eda3733d
23 changed files with 129 additions and 126 deletions

View File

@@ -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),