-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow sys.stdout to be replaced #88
Comments
Comment by corona10 I have one thing to discuss here. |
Comment by alanjds I totally agree, but am not mature enough on Golang to glance the implications of this change. |
Comment by corona10 I believe that more modules will be needed. e.g (socketModule etc..) |
Comment by alanjds This is no more a WIP, after changed from Will continue the google#290 implementation over this code. Please discuss what changes we want before this (#70) got be merged. |
Comment by trotterdylan I would avoid __getattribute__ and instead use __getattr__. The latter is called only after nothing is found through normal attribute lookup, which is probably what we want in this case. |
Comment by alanjds Me too. But this rabbit hole is getting too deep! This |
Comment by alanjds Just to say, tracebacks would be very nice. Took me quite a bit to realize this 'res' typo |
Comment by alanjds
@trotterdylan Are you ok with going on this way, and allow to use getattribute for now, or is better to go develop getattr before keep going on this PR? |
Comment by trotterdylan I think that __getattr__ should be fairly straightforward to implement. It needs a new slot and fallback logic in grumpy.GetAttr(). Also a few tests that validate the correct attribute resolution. |
Comment by alanjds Ok. Then I will chase __getattr__ on another PR. Everything else is ok? |
Comment by trotterdylan I think this is a little more complicated than I had hoped it would be. What if we get rid of the hybrid module concept and instead swap out sys.__dict__ something like this:
Currently __dict__ is not settable, but it will be once google#331 is merged. |
Comment by alanjds Hum... the whole point of this PR is allow If Seems to still need an |
Comment by trotterdylan Right, so the trick would be get rid of the Stdout, Stdin and Stderr grumpy package members and instead pull those from SysDict like
I don't think this is necessary if we do the __dict__ assignment at the very top of the module. |
google#302 opened on Apr 28, 2017 by @alanjds
Please refer to the discussion on google#290
Do not merge until
__getattr__
and__setattr__
is working.The text was updated successfully, but these errors were encountered: