Skip to content

esper.current_world not usable as a module-level property #100

Closed
@izzyboris

Description

Describe the bug
Unless I'm mistaken, Python doesn't allow module-level @Property declarations. It's not possible to use esper.current_world, as it just returns the property object, and a property can't be called either.

To Reproduce
Import esper and try to print(esper.current_world):

import esper
print(esper.current_world)
<property object at 0x000002826E75B5B0>
esper.current_world()
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode
    coro = func()
           ^^^^^^
  File "<input>", line 1, in <module>
TypeError: 'property' object is not callable

Expected behavior
esper.current_world (or esper.current_world() or similar) should print 'default' or whatever name the actual world is set to.

Development environment:

  • Python version: 3.11.4 (win64)
  • Esper version: 3.2

Additional context
N/A

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions