Skip to content

Gossip ignore define_hook kwargs if the hook was registered before #36

@ayalash

Description

@ayalash

Reproduction code:

import gossip

@gossip.register('hook_a')
def foo(**kwargs):
    pass

gossip.define('hook_a', tags=('my', 'tags'), arg_names=('x', 'y'))
gossip.define('hook_b', tags=('my', 'tags'), arg_names=('z', 'y'))

@gossip.register('hook_b')
def bar(**kwargs):
    pass

for hook in gossip.get_all_hooks():
  print(f'Hook: {hook.full_name}, tags: {hook.tags}, arguments: {hook.get_argument_names()}')

The output:

Hook: hook_a, tags: ('my', 'tags'), arguments: ()
Hook: hook_b, tags: ('my', 'tags'), arguments: ('z', 'y')

hook_b is as expected, but hook_a should add x & y as arguments

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions