[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-17 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, sorry, I misinterpreted Petr's comment, and then didn't look at the details of your PR before commenting. Having fixed that mistake, I agree that making the naive approach "just work" is a good option. -- ___ Py

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This change would break virtually all existing usages of PyCapsule_Import(). And it would look very surprising taking into account the name of this function. Currently "package.submodule.qual.name" imports package and accesses package.submodule.qual.name. Y

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-17 Thread Nick Coghlan
Nick Coghlan added the comment: The behaviour I'd expect to see: "module:qual.name" -> "imports module, accesses module.qual.name" "module.qual.name" -> "no implicit import, accesses module.qual.name" "package.submodule:qual.name" -> "imports package.submodule, accesses package.submodule.qual.

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-16 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-16 Thread Petr Viktorin
Petr Viktorin added the comment: Is "package.module:namespace.attribute" worth supporting? I guess it isn't, at least for now. So Serhyi's patch will work. -- ___ Python tracker _

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In your case importing xnd automatically imports xnd._xnd and sets it as an attribute of xnd. This case works now. PR 6898 adds support for cases when a submodule is not imported automatically by importing a package. --

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-16 Thread Stefan Krah
Stefan Krah added the comment: Ah, Serhiy stated the reason (module already imported) previously. Sorry for the noise. -- ___ Python tracker ___ __

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-16 Thread Stefan Krah
Stefan Krah added the comment: I'm sorry if this interrupts the discussion, but isn't this https://github.com/plures/xnd/blob/06f6dd82dda9c7bca5df30b121b5cd75c6337609/python/xnd/pyxnd.h#L103 of the form package.module.capsule? This works, and I just want to make sure it continues to do so. -

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Using ":" makes the syntax irregular. "package.module:attribute", but "module.attribute". And "package.module.attribute" works too if "package.module" already is imported. It is possible to support importing submodules without using ":". -- __

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +6568 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-15 Thread Eric Snow
Eric Snow added the comment: +1 on using ":" as the separator. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-03 Thread Nick Coghlan
Nick Coghlan added the comment: "package.module:attribute" is also the syntax used in packaging tools to unambiguously separate the name of the module to be imported from the attribute chain to be looked up within that module: https://packaging.python.org/specifications/entry-points/ So +1 f

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-02 Thread Petr Viktorin
Petr Viktorin added the comment: An option would be to use a colon to separate the module(s) from the attribute(s). The "inspect" module CLI does this, for example: https://docs.python.org/3/library/inspect.html#command-line-interface $ python3 -m inspect urllib.parse:SplitResult.geturl de

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-04-30 Thread Brett Cannon
Change by Brett Cannon : -- nosy: +petr.viktorin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-04-30 Thread lekma
lekma added the comment: thinking out loud here: maybe both behavior can be exposed, i.e. a PyCapsule_Import that would expect a valid import statement and a Py_GetCapsule that would behave more like getattr? -- ___ Python tracker

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2017-12-24 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +brett.cannon, eric.snow, ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2017-12-24 Thread lekma
lekma added the comment: > PR 4988 will break the case 'module.attr.capsule' if 'module.attr' is > not a module. you are right, but is that a case you would expect in an import statement? -- ___ Python tracker __

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2017-12-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 4988 will break the case 'module.attr.capsule' if 'module.attr' is not a module. -- nosy: +serhiy.storchaka ___ Python tracker ___ _

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2017-12-23 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +4874 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-lis

[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2017-12-23 Thread lekma
New submission from lekma : When capsule name is in the form 'package.module.capsule', PyCapsule_Import fails with an AttributeError (module is never an attribute of package). -- components: Interpreter Core messages: 308950 nosy: lekma priority: normal severity: normal status: open tit