Skip to content

The compat modules should use absolute imports #3975

Closed

Description

@abalkin

The statsmodels.compat.collections imports the namesake standard library module without requesting absolute imports. While it seems to work in many cases, it causes a problem to packages that override __import__. See KxSystems/pyq#18.

Please consider adding

from __future__ import absolute_import

to the compat modules.

Activity

  1. added a commit that references this issue on Oct 5, 2017
    de8f770
  2. josef-pkt commented on Oct 5, 2017

    @josef-pkt
    Member

    Our related packages numpy, pandas, scipy have the future import, but not the python compat modules

  3. added this to the 0.9 milestone on Oct 5, 2017
  4. josef-pkt commented on Oct 5, 2017

    @josef-pkt
    Member

    However, AFAICS, both ordereddict and counter are in python 2.7, so the collections compat is not needed anymore.

  5. abalkin commented on Oct 5, 2017

    @abalkin
    ContributorAuthor

    I looked in setup.py and you seem to still support 2.6. It may be time to drop it given that numpy and scipy did so recently.

  6. josef-pkt commented on Oct 5, 2017

    @josef-pkt
    Member

    We did drop it, at least we stopped including python 2.6 in our unit tests.
    However, unless we explicitly remove python 2.6 compatible code, statsmodels will still work with python 2.6 for most parts, with maybe just a few exceptions.
    (I have no idea right now, given that I haven't even used python 2.7 in a long time.)

  7. added a commit that references this issue on Nov 4, 2017
    fd00623
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions