MCPcopy Create free account
hub / github.com/dabeaz/python-cookbook / Spam

Class Spam

src/9/multiple_dispatch_with_function_annotations/example1.py:88–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87# Some example classes that use multiple dispatch
88class Spam(metaclass=MultipleMeta):
89 def bar(self, x:int, y:int):
90 print('Bar 1:', x, y)
91 def bar(self, s:str, n:int = 0):
92 print('Bar 2:', s, n)
93
94# Example: overloaded __init__
95import time

Callers 1

example1.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected