2016-09-26 19:00:52 +0200 | asked a question | Problem with Sequence command Computation of gcd of objects of a class a created fails. I investigated the case and traced down that the problem lies in Sequence command. Consider the following example class: Create and example object:
Build a nested object:
Everything works as expected. So let's iterate over A:
So far so good. Let's use Sequence as gcd internally does:
And boom! Something went wrong. Try to call len explicitly:
The same error! Surprisingly the following code actually works (but IMHO it should not):
It seems like something strange happens in initialization. When creating a sequence, all objects get initialized by themselves. Ok. So here is my question: what's up? Do I do something wrong or is this a bug in Thanks in advance, Przemek |
2016-09-26 19:00:52 +0200 | asked a question | Strange behaviour of `Sequence' Computation of gcd of objects of a class a created fails. I investigated the case and traced down that the problem lies in Sequence command. Consider the following example class: Create and example object:
Build a nested object:
Everything works as expected. So let's iterate over A:
So far so good. Let's use Sequence as gcd internally does:
And boom! Something went wrong. Try to call len explicitly:
The same error! Surprisingly the following code actually works (but IMHO it should not):
It seems like something strange happens in initialization. When creating a sequence, all objects get initialized by themselves. Ok. So here is my question: what's up? Do I do something wrong or is this a bug in Thanks in advance, Przemek |