Skip to content

The __transient__ attribute. What is it? Could it be thrown away? #108

@Peque

Description

@Peque

It seems it is not a standard Python dunder attribute. For what I have seen it is used to exclude some attributes from __dict__ before serialization.

Why is this used instead of __getstate__?

It seems in save_inst() you are actually trying to use __getstate__ first if it exists, and only if it does not, then you look for __transient__. However, in save_reduce() you are always directly trying to look for this attribute (if protocol version is >= 2). Is this necessary? Couldn't __getstate__ tried to be used as well first?

Cross reference: irmen/Pyro4#179

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions