heros.inspect

Attributes

Functions

_mark(→ callable)

Mark a callable with a provided marker.

_is_marked(→ bool)

Inspect if a callable is marked with a provided marker.

mark_hero_event(→ callable)

Mark a callable as a event.

mark_hero_method(→ callable)

Mark a callable as a method of a (remote) hero.

mark_local_only(→ callable)

Mark a callable is local only.

mark_force_remote(→ callable)

Mark a callable as force remote.

is_hero_event(→ bool)

Check if a callable is a event.

is_hero_method(→ bool)

Check if a callable is a method of a (remote) hero.

is_local_only(→ bool)

Check if a callable is a local only.

is_force_remote(→ bool)

Check if a callable is a force remote.

Module Contents

heros.inspect.HERO_EVENT_ATTRIBUTE = 'hero_event'
heros.inspect.HERO_METHOD_ATTRIBUTE = 'hero_method'
heros.inspect.LOCAL_ONLY_ATTRIBUTE = 'local_only'
heros.inspect.FORCE_REMOTE_ATTRIBUTE = 'force_remote'
heros.inspect._mark(func: callable, marker: str) callable

Mark a callable with a provided marker.

Parameters:
  • func – callable to mark

  • marker – attribute name at which to mark the callable

Returns:

The marked callable.

heros.inspect._is_marked(func: callable, marker: str) bool

Inspect if a callable is marked with a provided marker.

Parameters:
  • func – callable to check

  • marker – attribute name of the attribute to check

Returns:

The value of the marker. False if the marker is not present.

heros.inspect.mark_hero_event(func: callable) callable

Mark a callable as a event.

Parameters:

func – callable to mark

Returns:

The marked callable.

heros.inspect.mark_hero_method(func: callable) callable

Mark a callable as a method of a (remote) hero.

Parameters:

func – callable to mark

Returns:

The marked callable.

heros.inspect.mark_local_only(func: callable) callable

Mark a callable is local only.

Parameters:

func – callable to mark

Returns:

The marked callable.

heros.inspect.local_only
heros.inspect.mark_force_remote(func: callable) callable

Mark a callable as force remote.

Parameters:

func – callable to mark

Returns:

The marked callable.

heros.inspect.force_remote
heros.inspect.is_hero_event(func: callable) bool

Check if a callable is a event.

Parameters:

func – callable to check

Returns:

The value of the marker. False if the marker is not present.

heros.inspect.is_hero_method(func: callable) bool

Check if a callable is a method of a (remote) hero.

Parameters:

func – callable to check

Returns:

The value of the marker. False if the marker is not present.

heros.inspect.is_local_only(func: callable) bool

Check if a callable is a local only.

Parameters:

func – callable to check

Returns:

The value of the marker. False if the marker is not present.

heros.inspect.is_force_remote(func: callable) bool

Check if a callable is a force remote.

Parameters:

func – callable to check

Returns:

The value of the marker. False if the marker is not present.