Skip to content

Commit

Permalink
Don't explicitly derive from object in Python (#1552)
Browse files Browse the repository at this point in the history
That's an artifact from Python 2, Python 3 does that automatically.
  • Loading branch information
heinrich5991 authored May 23, 2023
1 parent cb52566 commit bffc5d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self):

# Each enum variant is a nested class of the enum itself.
{% for variant in e.variants() -%}
class {{ variant.name()|enum_variant_py }}(object):
class {{ variant.name()|enum_variant_py }}:
def __init__(self,{% for field in variant.fields() %}{{ field.name()|var_name }}{% if loop.last %}{% else %}, {% endif %}{% endfor %}):
{% if variant.has_fields() %}
{%- for field in variant.fields() %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{%- let obj = ci.get_object_definition(name).unwrap() %}

class {{ type_name }}(object):
class {{ type_name }}:
{%- match obj.primary_constructor() %}
{%- when Some with (cons) %}
def __init__(self, {% call py::arg_list_decl(cons) -%}):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __str__(self):
return "ForeignBytes(len={}, data={})".format(self.len, self.data[0:self.len])


class RustBufferStream(object):
class RustBufferStream:
"""
Helper for structured reading of bytes from a RustBuffer
"""
Expand Down Expand Up @@ -140,7 +140,7 @@ def readDouble(self):
def readCSizeT(self):
return self._unpack_from(ctypes.sizeof(ctypes.c_size_t) , "@N")

class RustBufferBuilder(object):
class RustBufferBuilder:
"""
Helper for structured writing of bytes into a RustBuffer.
"""
Expand Down

0 comments on commit bffc5d8

Please sign in to comment.