pyv8 icon indicating copy to clipboard operation
pyv8 copied to clipboard

Added simple encapsulation

Open desertkun opened this issue 8 years ago • 1 comments

Python object could have private fields that would be great to have hidden from javascript for security reasons.

That's why this pull requests returns null for every python property starting with _. Same applies to writing/deleting/iterating through object.

class Test(object):
    def __init__(self):
        self.test_a = 1
        self._test_b = 2

Therefore, test_a is accessible, but _test_b is not.

desertkun avatar Jan 28 '17 13:01 desertkun

Adding @flier to the thread for a fruitful discussion.

PS Moreover it would be great if we all could invest time and effort on this branch

https://github.com/flier/pyv8/tree/v5_api

which attempts to port PyV8 to the latest V8 API version.

buffer avatar Jan 30 '17 18:01 buffer