Product inheritence causes infinite recursion

Issue #838 open
Nathan Ekstrom
created an issue

If you inherit from the Product object there are several places where infinite recursion occurs.

Comments (8)

  1. Sébastien Fievet

    Hi,

    Recursion bug still happens to me. I'm using subclassing for custom product (e.g., class MyProduct(Product)).

    I've attached a patch to solve this issue : instead of using hasattr that use recursion to find an attribute/method, lookup into class.dict.

    I run the products tests, and everything is working fine for me.

    Thanks.

    Sebastien

  2. Hynek Cernoch

    @Sébastien wrote:

    instead of using hasattr that use recursion to find an attribute/method...


    Function hasattr uses no recursion but heredity. Did you created dědičnost statically or dynamically? I hope that Python does not allow a class, which is itself somehow an ancestor.

    Are you sure that cause of infinite recursion is not in your code? It would be a pity just to spoil a nice code. Do you have a short reproducible example? (Very simple class MyProduct and created several products from the command line.)

  3. Log in to comment