Skip to content

Add explicit no-op argument converter for object #5529

@pekkaklarck

Description

@pekkaklarck

In Python's typing object and Any are in many ways similar, but there are subtle differences making one better than the other in certain context. We added an explicit converter that does nothing for Any in RF 6.1 and the reasons explained in #4647 apply also to object. In addition to that, the current situation is inconsistent.

A comment in the aforementioned issues explains why adding a converter for a currently unrecognized type is backwards-incompatible. In practice the behavior changes so that if you have

def example(arg: object = 1):
    ...

there's no conversion attempted based on the default value type anymore. This kind of typing ought to be rare and the problem is easy to avoid by using arg: int | object = 1 instead. I thus consider the change fine also in a non-major release.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions