0

I'm curious, for a small custom python package.

If I run the python file that imports and uses function from the package in python2, everything works fine. If I run the file in python3 though it fails importing functions from the package.

    from cust_package import this_function
ImportError: cannon import name 'this_function'

The functions in the package seem to be python3 compatible, and I used futurize on them just in case. Is the issue to do with some sort of labeling of the package/python version? The package is tiny, 2 .py files of ~8 functions each.

Appreciate the help, thanks!

singmotor
  • 3,930
  • 12
  • 45
  • 79
  • Can you provide us with an example of this behavior please? – Laraconda Mar 15 '17 at 05:23
  • @LaraChicharo I updated the question to be about the real issue, including error message. The dir() issue was just a symptom of the actual problem. Thank you for pushing me to clarify. – singmotor Mar 15 '17 at 17:28

1 Answers1

2

The default dir() mechanism behaves differently with different types of objects, as it attempts to produce the most relevant, rather than complete, information.

Dir documentation

There are available questions if you want all the available functions. here

Community
  • 1
  • 1
Amarpreet Singh
  • 2,242
  • 16
  • 27
  • You're correct, and I've updated the question to reflect the real issue, as the dir() complication is really just a symptom of the issue. I'm sorry for failing to clarify until now. – singmotor Mar 15 '17 at 17:29