These are chat archives for dropbox/pyston

24th
Oct 2015
Sun
@Daetalus
Oct 24 2015 04:37
Hi @kmod @undingen , in order to let help(int) could work. I think BoxedFunction need to take doc and name parameters, just like BoxedBuiltinFunctionOrMethod did. Can I adjust the BoxedFunction constructor?
@undingen thanks for your detailed answer!!!
An Long
@aisk
Oct 24 2015 04:59
@kmod yes, I'll try this ,thx !
Sun
@Daetalus
Oct 24 2015 05:05
FYI, #982 related with the AST stuff...
@aisk
An Long
@aisk
Oct 24 2015 05:10
@Daetalus Oh I see it, is this PR, I think we will use the whole Cpython's parser stuff ?
Sun
@Daetalus
Oct 24 2015 05:35
I don't know...
An Long
@aisk
Oct 24 2015 06:10
:worried: I want know should I stop the ast.cpp generation work
Kevin Modzelewski
@kmod
Oct 24 2015 07:58
it might be good to hold off on doing more work
since if I can get the cpython parser in, we'll likely want to go with their ast module too
but even if we end up going with the cpython parser + ast module, it'd still be helpful in the short/medium term to have better ast module support
Sun
@Daetalus
Oct 24 2015 07:58
What about the BoxedFunction parameter issue?
Kevin Modzelewski
@kmod
Oct 24 2015 07:59
and I'm not sure how quickly we'll migrate stuff over
not very familiar with the BoxedFunction code
should int() be a BoxedBuiltinFunctionOrMethod?
also, I wasn't trying to say help(int) is necessary, it's just what I happened to try :P
Sun
@Daetalus
Oct 24 2015 08:03
The methods under int_cls should have doc and name attribute. But BoxedFunction didn't fill it. Only BoxedBuiltinFunctionOrMethod fill these attribute when construct a new builtin function.
So my suggestion is let BoxedFunction also take doc and name as parameter.
Kevin Modzelewski
@kmod
Oct 24 2015 08:04
yeah that sounds reasonable
but we haven't been thoughtful at all about which things are BoxedFunction's and which and BoxedBultinFunctionOrMethods
so I was just wondering if maybe that could be part of the issue (that that function should be the other kind)
but anyway, yeah an argument to the BoxedFunction constructor sounds like probably a good idea regardless
Sun
@Daetalus
Oct 24 2015 08:07
I see. I mean the function added by xxx_cls->giveAttr(new BoxedFunction(...)) in builtin types.
Kevin Modzelewski
@kmod
Oct 24 2015 08:08
yeah, I think some of those are BoxedBuiltinFunctionOrMethods
we originally added them all as BoxedFunctions
and then learned that there is another different kind that many of them are supposed to be
and then we changed a few that mattered but most of them just stayed as BoxedFunctions
Sun
@Daetalus
Oct 24 2015 08:09
Does there has a rule(or a list) to determine which are builtin functions?
Kevin Modzelewski
@kmod
Oct 24 2015 08:13
hmm I don't remember exactly
they got added in #285 which has some comments
Sun
@Daetalus
Oct 24 2015 08:13
Ok, I will use type(foo) one by one.
Kevin Modzelewski
@kmod
Oct 24 2015 08:13
but I guess int specifically isn't going to be either, it's a class
sorry, I wouldn't worry too much about it, just wanted to bring it up :)
Sun
@Daetalus
Oct 24 2015 08:14
int is doesn't matter. Just the function in it.
If my understanding is correct, pydoc.py will check the type in help().
Sun
@Daetalus
Oct 24 2015 08:30
Sorry, after take a look at CPython. The "functions" under a type, for example, int.__add__, should be wrapper_descriptor, neither instancemethod(which we use for now) nor builtin_function_or_method.
Sun
@Daetalus
Oct 24 2015 08:48
Maybe we can support help(foo) first.