Skip to content

Erroneous mypy specifications #70

Description

@artivis

Edit:
I've been using import_message_from_namespaced_type wrong due to misleading erroneous mypy specifications

def import_message_from_namespaced_type(message_type: NamespacedType)

Leaving this issue open until the specification get fixed.

Original:

Bug report

Required Info:

  • Operating System:
    • Ubuntu 18.04
  • Installation type:
    • source
  • Version or commit hash:
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):
    • rclpy

Steps to reproduce issue

from rosidl_parser.definition import NamespacedType
from rosidl_runtime_py.import_message import import_message_from_namespaced_type

message = import_message_from_namespaced_type(
            NamespacedType(['std_msgs', 'msg'], 'Bool'))

Expected behavior

Imports a std_msgs/msg/Bool

Actual behavior

Crash

AttributeError: 'NamespacedType' object has no attribute 'value_type'

Additional information

Crash comes from import_message_from_namespaced_type which expects a NamespacedType for input arg. NamespacedType expects as input args Iterable[str], str.

NamespacedType has base AbstractNestableType whereas the '__slots__' value_type comes from AbstractNestedType. Am I missing something or is it a bug ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions