tbodt / v8py

Write Python APIs, then call them from JavaScript using the V8 engine.
GNU Lesser General Public License v3.0
443 stars 29 forks source link

Make Context subtypable #12

Closed buffer closed 7 years ago

codecov-io commented 7 years ago

Codecov Report

Merging #12 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #12   +/-   ##
=======================================
  Coverage   67.79%   67.79%           
=======================================
  Files          16       16           
  Lines        1180     1180           
  Branches      184      184           
=======================================
  Hits          800      800           
  Misses        257      257           
  Partials      123      123
Impacted Files Coverage Δ
v8py/context.cpp 77.18% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ff13a75...8e95a80. Read the comment docs.

tbodt commented 7 years ago

What would a subclass of Context be useful for?

buffer commented 7 years ago

I am currently porting a project from PyV8 to v8py. PyV8 defines its JSContext object as a context manager and I already submitted a PR for that (https://github.com/tbodt/v8py/pull/7). In case you do not want to make the Context object a context manager giving the possibility to wrap this feature through subclassing could be useful.

tbodt commented 7 years ago

I'm not sure why it would be useful to subclass Context, but there's not really any reason not to allow it.