[IronPython] [Simpy-users] Simpy not working on IronPython because of type(generator) problem
Klaus Muller
kgmuller at xs4all.nl
Wed Dec 21 12:24:48 CET 2005
Stan,
The simplest solution for the moment is to take out that test. If one calls
activate with a non-generator parameter, it will just bomb out later. No
problem!
Klaus
> -----Original Message-----
> From: simpy-users-admin at lists.sourceforge.net
> [mailto:simpy-users-admin at lists.sourceforge.net] On Behalf Of
> Stanislas Pinte
> Sent: Wednesday, December 21, 2005 10:28 AM
> To: users at lists.ironpython.com
> Cc: simpy-users at lists.sourceforge.net
> Subject: [Simpy-users] Simpy not working on IronPython
> because of type(generator) problem
>
> Hello,
>
> Internally we use a wonderful simulation framework written in
> python: http://simpy.sourceforge.net/
>
> I cannot make it work on python because it rests on generators...
>
> the main loop of simpy uses type(myFunction) ==
> types.GeneratorType) to determine if it is a generator or not...
>
> > if not (type(process) == types.GeneratorType):
> > raise Simerror("Fatal SimPy error: activating
> function which"+
> > " is not a generator (contains no 'yield')")
>
> However, in IronPython:
>
> >>> import types
> >>> def gentest():
> for i in range(0,10):
> yield i
> >>> print type(gentest)
>
> <type '__main__+gentest0'>
>
> whereas in CPython it returns
>
> <type 'generator'>
>
> Any idea if we can fix this easely?
>
> thanks,
>
> Stan.
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep
> through log files for problems? Stop! Download the new AJAX
> search engine that makes searching your log files as easy as
> surfing the web. DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Simpy-users mailing list
> Simpy-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/simpy-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3936 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20051221/262bb6c0/attachment.bin>
More information about the Ironpython-users
mailing list