[Scons-users] Creating a class in a SConscript

Bill Deegan bill at baddogconsulting.com
Thu May 4 15:14:35 EDT 2017


Can you provide a small complete example? (A SConstruct which demonstrate
this?)

On Thu, May 4, 2017 at 3:05 PM, Dynastic Space <dynasticspace at gmail.com>
wrote:

> I have a python script defining a hierarchy of classes. This script is not
> part of the scons environment.
>
> In a SConscript file I derive from one of the classes defined in my script.
>
> I store an instance of the new class in the environment, to access it
> later in my script.
> However, when I use isinstance(instance, MyParentClass) it returns False.
>
> See the following print:
> binary: app type: <class 'SCons.Script.MyAppBinaryDesc'> instance of
> AppBinaryDesc: False hierarchy: (<class 'SCons.Script.MyBinaryDesc'>,
> <class 'binary_descriptor.SPAppBinaryDesc'>, <class 'binary_descriptor.AppBinaryDesc'>,
> <class 'binary_descriptor.BuildableDesc'>, <class
> 'binary_descriptor.BinaryDesc'>, <type 'object'>)
>
> The instantiated object is app.
> The class that was instantiated in my SConscript is MyAppBinaryDesc.
> I use isinstance(app, AppBinaryDesc) which returns False.
>
> I expect it to return 'True', as the hierarchy clearly shows
> MyAppBinaryDesc inheriting from AppBinaryDesc.
>
> I tried importing SCons.Script in my script, but that did not help.
>
> Thanks,
>
> Howling
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170504/b9919cc0/attachment.html>


More information about the Scons-users mailing list