Skip to content

Alias to qualified module does not work #3669

Closed

Description

@JukkaL

This program generates an unexpected error:

import os.path
x = os.path
x.isdir('/') # Module has no attribute "isdir"

However, this works:

from os import path
x = path
x.isdir('/') # Ok

Module aliasing was implemented in #3435.

Activity

  1. ilevkivskyi commented on Jul 7, 2017

    @ilevkivskyi
    Member

    I think this might be an one-line fix. Just use RefExpr instead of NameExpr in semanal.process_module_assignment. I can take a look at it this evening.

  2. ilevkivskyi commented on Jul 8, 2017

    @ilevkivskyi
    Member

    OK, it is slightly more complex than I thought, here is the PR #3680.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions