Hi Vaci, I suspect pycapnp currently lacks support for specifying generic type parameters. You might want to file an issue on pycapnp's github about that.
However, I suspect you can work around it by defining the type specializations you need in a .capnp file (which could be a private file used by your server), like: interface FooMyType extends(Foo(MyType)) {} # Extend FooMyType in Python when you really want to extend Foo(MyType). interface FooAny extends(Foo) {} # Extend FooAny in Python when you really want to implement a generic Foo interface. -Kenton On Mon, Jun 22, 2020 at 8:32 AM Vaci <v...@vaci.org> wrote: > Given a generic Capnproto interface, such as: > > interface Foo(X) > { > bar @0 (baz :X); > } > > > How would one implement a server for Foo using pycapnp? > > The following python code doesn't work, presumably as Foo.Server is not a > concrete type: > > class MyFoo(Foo.Server): > def bar_context(self, ctx, **kwargs): > pass > > > When I attempt to pass my server as an interface parameter, I get the > error: > > "failed: expected capability.getSchema(),extends(interfaceType); Value > type mismatch." > > > I'd be happy to use a Foo(Any).Server, if that was all I could get... > > Vaci > > > -- > You received this message because you are subscribed to the Google Groups > "Cap'n Proto" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to capnproto+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/capnproto/0e8ee233-f7a1-4bee-ad55-71c83225ffc4o%40googlegroups.com > <https://groups.google.com/d/msgid/capnproto/0e8ee233-f7a1-4bee-ad55-71c83225ffc4o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Cap'n Proto" group. To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/CAJouXQnRzxzG9Bwz5CG3Jw8Uo%2BDDrbrvC6KGOnpasSrkkgTLxg%40mail.gmail.com.