Skip to content

[Bug Report] Add return type to close in the class Env #1339

Open
@LinHungShi

Description

@LinHungShi

Describe the bug

The return type of close is not annotated, which causes

Call to untyped function "close" in typed context  [no-untyped-call]

if the caller function is typed.

Code example

Edit the file test.py and add the following code:


import gymnasium as gym

def func() -> None:
        env = gym.make('CartPole-v1')
        env.close()


After that, execute the command:


mypy test.py

System info

gym version: 1.1.0
OS: MacOS

Additional context

No response

Checklist

  • I have checked that there is no similar issue in the repo

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