Skip to content

builtinmodule.SomeClass.some_instance_property mistakenly calls getter for the property #1027

@dhalbert

Description

@dhalbert

This will generate a hard fault:

import analogio
analogio.AnalogIn.value

Similarly true for storage.VfsFat.label, touchio.TouchIn.value, etc.

The problem is that instead of returning a property object, the reference to the property actually calls the get function for the property, passing in self=0x0.

Some things don't crash because they actually ignore the self value, e.g. microcontroller.Processor.temperature, but that actually returns the temperature, which is wrong.

This problem has existed since the beginning: in 1.0.0, analogio.AnalogIn.value returns 0, not a property object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions