python-postgres / be

pg-python: Execute Python 3 code from PostgreSQL functions.
Other
5 stars 2 forks source link

Extend Stateful for Closures #3

Closed jwp closed 10 years ago

jwp commented 14 years ago

Currently Postgres.Stateful wants a generator.

Sometimes, caching a simple callable makes sense over using a generator in order to leverage closures.

Potentially, this should be implemented using a distinct type. Postgres.Closure?

jwp commented 14 years ago

I don't think extending stateful is appropriate. Much of the logic therein is quite particular to generators. src/closure.c methinks.

jwp commented 14 years ago

I removed the critical label as ISTM that some more thought might be desirable. It makes sense, but the initial double call required by closure seems suspicious.

jwp commented 10 years ago

I don't see this as being advantageous. Generator works fine and can used to implement a closure approach.