On Tue, Aug 2, 2016 at 1:45 AM, Lawrence D’Oliveiro
wrote:
> On Friday, July 29, 2016 at 6:25:51 AM UTC+12, Enjoys Math wrote:
>
>> exec('obj = ' + objType + '(self)', None, _locals)
>> obj = _locals['obj']
>
> Why? Why not just
>
> obj = objType(self)
I think
On Friday, July 29, 2016 at 6:25:51 AM UTC+12, Enjoys Math wrote:
> exec('obj = ' + objType + '(self)', None, _locals)
> obj = _locals['obj']
Why? Why not just
obj = objType(self)
?
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Jul 28, 2016 at 6:40 PM, Chris Angelico wrote:
> On Fri, Jul 29, 2016 at 1:47 AM, Enjoys Math wrote:
>> I've manually set breakpoints and traced this app crash back to this
>> function:
>>
>> def loadLSobjsOfType(self, objType, listJ):
>> if listJ != None:
>> for o
On Thu, Jul 28, 2016, at 11:47, Enjoys Math wrote:
> So what's the proper way to get the return value of an exec call when
> there is one?
Exec calls do not have return values.
If you need to pass an object out of the exec call to the surrounding
context, you can wrap it in an exception and throw
On Fri, Jul 29, 2016 at 1:47 AM, Enjoys Math wrote:
> I've manually set breakpoints and traced this app crash back to this
> function:
>
> def loadLSobjsOfType(self, objType, listJ):
> if listJ != None:
> for objJ in listJ:
> _locals = locals()
>
I've manually set breakpoints and traced this app crash back to this
function:
def loadLSobjsOfType(self, objType, listJ):
if listJ != None:
for objJ in listJ:
_locals = locals()
exec('obj = ' + objType + '(self)', None, _locals)