random.seed() vs R21

  • Hi,

    Can anyone confirm random.seed() is throwing an error in R21?

    alt text


  • Nope. Same commands work fine here (R21.022)

  • Hi,

    I cannot reproduce this neither. The interesting question would be what does print random.seed for you and is this reproduceable on your end?

    My suspicion would be that someone or something treated random.seed() like a property instead of like a function, which then led to - with all the "Python functions are first class objects" thing - random.seed being an integer. Something like this:

    >>> import random
    >>> print(random.seed)
    <bound method Random.seed of <random.Random object at 0x103b62218>>
    >>> random.seed(12345)
    >>> random.seed = 12345 # 'accidently' treating it like a property
    >>> print(random.seed)
    >>> random.seed(12345)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    TypeError: 'int' object is not callable


  • Hello,

    I couldn't reproduce this neither.
    As @zipit said in his last post, this could explain why you have this message.

    But relaunching cinema4D would reset everything.


  • @zipit Thanks for the insight! This makes sense, I vaguely recall typo-ing random.seed and forgetting the () and it threw an error so I fixed that, went writing more of the code and then didn't relate this error back to that brief moment. I don't recall assigning it as a property, but I do have a seed = 12345 elsewhere in the code, so maybe I did!

    Thanks all for sanity-checking it, solved.


Log in to reply