[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2018-02-18 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: FWIW, this is fixed in 3.7 by PEP 560. I don't think we will be able to get rid of `sys._getframe` workaround on 3.6, so I propose to just close this. -- dependencies: -Provide a way to check for *real* typing.Union instances

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2017-10-18 Thread Wilfred Hughes
Wilfred Hughes added the comment: Note that this also affects the singledispatch library that backports singledispatch to Python 2: https://github.com/python/typing/issues/484 -- nosy: +Wilfred.Hughes ___ Python tracker

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2017-01-18 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: The problem is the only good way to fix this I see now is patching two lines in functools and abc using the public ``typing_inspect`` API proposed in http://bugs.python.org/issue29262 (I added it as a dependency). The latter could take some time, so that I

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2017-01-17 Thread Larry Hastings
Changes by Larry Hastings : -- nosy: -larry ___ Python tracker ___ ___ Python-bugs-list

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2017-01-17 Thread Guido van Rossum
Guido van Rossum added the comment: @levkivskyi Do you want to attempt a better fix in tome for 3.6.1? -- ___ Python tracker ___

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-12-07 Thread Guido van Rossum
Changes by Guido van Rossum : -- priority: deferred blocker -> normal ___ Python tracker ___

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-12-07 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: The failure is fixed now, but it is fixed not in an elegant way (sys._getframe is used). I think this is not urgent. If there are no objections, then I would propose to change priority to normal. -- ___ Python

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-12-06 Thread Ned Deily
Ned Deily added the comment: This is still marked as "deferred blocker". Is there anything more that needs to be done for 3.6.0? I'm assuming not. -- ___ Python tracker

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Guido van Rossum
Guido van Rossum added the comment: Hm. I agree that _getframe() is horrible. But I'm not sure I want code outside typing.py to be aware of __origin__. -- priority: release blocker -> deferred blocker ___ Python tracker

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I tried and all tests pass on 3.7a also with prior import of typing. A larger fix is not _necessary_, but I would _prefer_ to go with the option 4 that I proposed above, i.e.: Instead of special casing abc and functools in __subclasshook__ in typing via

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Guido van Rossum
Guido van Rossum added the comment: So is a larger fix not necessary? If so we can close this (assuming the tests now pass). -- ___ Python tracker ___

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I think this is the right way to fix this, as discussed on python-dev, memoryview is not considered consistent with ByteString. -- ___ Python tracker

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Guido van Rossum
Guido van Rossum added the comment: Maybe this fix helps? I tried your repro and it no longer fails. -- ___ Python tracker ___

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 69fe5f2e5aae by Guido van Rossum in branch '3.5': Issue #28339: Remove ByteString.register(memoryview(...)) from typing.py. https://hg.python.org/cpython/rev/69fe5f2e5aae New changeset 8958836a2c89 by Guido van Rossum in branch '3.6': Issue #28339:

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Guido van Rossum
Guido van Rossum added the comment: Oh the line ByteString.register(type(memoryview(b''))) should be removed from typing.py. -- priority: deferred blocker -> release blocker ___ Python tracker

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-08 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: All tests from test_functools.py now pass. test.test_collections.TestCollectionABCs.test_ByteString() from test_collections.py still fails (as reported in msg277953). LD_LIBRARY_PATH="$(pwd)" ./python -c 'import runpy, typing;

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-08 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- Removed message: http://bugs.python.org/msg278344 ___ Python tracker ___

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-08 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: All tests from test_functools.py now pass. test.test_collections.TestCollectionABCs.test_ByteString() from test_functools.py still fails (as reported in msg277953). LD_LIBRARY_PATH="$(pwd)" ./python -c 'import runpy, typing;

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-08 Thread Guido van Rossum
Guido van Rossum added the comment: Making it a deferred release blocker so we're reminded to do the more thorough fix before 3.6.0 rc1. -- priority: release blocker -> deferred blocker ___ Python tracker

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-07 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Since the quick fix is now applied, I think it should not be a release blocker any more. -- ___ Python tracker ___

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-03 Thread Guido van Rossum
Guido van Rossum added the comment: I have merged the upstream fix (and some other things) into 3.5, 3.6, 3.7. changeset: 104262:7f0d27180b6d tag: tip parent: 104259:36b052adf5a7 parent: 104261:0e0189b47291 user:Guido van Rossum date:Mon

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-03 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I have submitted a PR with one of the quick fixes upstream (to python/typing). Also I have played a bit with a more permanent fix. Here is an important observation: it is not easy to avoid adding parameterized generics to __subclasses__. For example,

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-03 Thread Chi Hsuan Yen
Changes by Chi Hsuan Yen : -- nosy: +Chi Hsuan Yen ___ Python tracker ___ ___

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-02 Thread Guido van Rossum
Guido van Rossum added the comment: Offline, Ivan and I have discussed a solution. We can make a small incision in typing.py that will fix this, at the cost of still allowing isinstance()/issubclass()). We also have a slightly better quick fix in mind. Ultimately we will have a more complex

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-02 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry about that. I haven't looked into this but I suspect this is due to some manipulation of the ABC registry by typing.py that exceed their intended scope. I'll ask Ivan to fix it; if he's not available before b2 goes out I'll roll this back. --

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-02 Thread Arfrever Frehtes Taifersar Arahesis
New submission from Arfrever Frehtes Taifersar Arahesis: Commits 09cc43df4509 (3.5), 81f27d3ab214 (3.6), 8f0df4db2b06 (3.7) cause "TypeError: Parameterized generics cannot be used with class or instance checks" errors in 4 tests in Lib/test/test_functools.py file in situation when typing