Issue1132
Created on 2008-09-15.17:45:32 by ericjacobs, last changed 2018-03-07.19:53:16 by jeff.allen.
msg3600 (view) |
Author: Eric Jacobs (ericjacobs) |
Date: 2008-09-15.17:45:31 |
|
It should be possible to assign metaclasses to classes that are derived
from Java classes.
import java
class MyClass(java.lang.Object):
class __metaclass__(type(java.lang.Object)):
def __new__(cls, name, bases, dict):
return super(cls, cls).__new__(cls, name, bases, dict)
o = MyClass()
This results in the cryptic error message:
TypeError: class.__new__(__metaclass__) is not safe, use
__metaclass__.__new__()
|
msg3601 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2008-09-15.18:33:26 |
|
Note that this is the same error message emitted by the failing test_copy
test_copy_atomic and test_deepcopy_atomic -- so they may be related to
this issue
|
msg3610 (view) |
Author: Eric Jacobs (ericjacobs) |
Date: 2008-09-20.16:51:32 |
|
Okay, I've looked at the test_copy and entered that as a separate issue
-- as it was unrelated.
It looks like the best way to go forward with fixing the problems with
the Java object support is to bite the bullet, kill the hacks into
PyClass/PyInstance, and refactor PyJavaClass as a proper new-style type.
This is the approach I will take.
|
msg8545 (view) |
Author: Jim Baker (zyasoft) |
Date: 2014-05-22.01:41:11 |
|
For the case provided by the user, we get java.lang.InstantiationException: java.lang.InstantiationException: can't subclass final class
I believe this of java.lang.Object, but this seems to be broader as well. Let's revisit this interesting corner case.
Note that 7175:b4ae9e2893c8 introduced some changes in how Java types act as metaclass bases, as is used by Clamp.
|
msg8546 (view) |
Author: Jim Baker (zyasoft) |
Date: 2014-05-22.01:43:09 |
|
Duhh, java.lang.Object is the root of all classes, not a bottom type :)
|
msg9635 (view) |
Author: Jim Baker (zyasoft) |
Date: 2015-03-12.00:36:59 |
|
2.7.1
|
|
Date |
User |
Action |
Args |
2018-03-07 19:53:16 | jeff.allen | set | milestone: Jython 2.7.2 -> |
2016-02-26 19:24:17 | zyasoft | set | milestone: Jython 2.7.2 |
2015-03-12 00:36:59 | zyasoft | set | messages:
+ msg9635 |
2014-09-26 06:10:31 | zyasoft | set | priority: normal -> low |
2014-05-22 01:43:09 | zyasoft | set | messages:
+ msg8546 |
2014-05-22 01:41:11 | zyasoft | set | nosy:
+ zyasoft messages:
+ msg8545 |
2013-02-26 17:16:33 | fwierzbicki | set | nosy:
+ fwierzbicki |
2013-02-25 18:46:21 | fwierzbicki | set | versions:
+ Jython 2.5, - 2.5.1 |
2009-03-14 14:22:02 | fwierzbicki | set | priority: normal versions:
+ 2.5.1, - 2.2.2 |
2009-03-14 14:06:18 | fwierzbicki | set | versions:
+ 2.2.2, - 2.2.1rc1 |
2008-09-20 16:51:33 | ericjacobs | set | messages:
+ msg3610 |
2008-09-15 18:33:26 | pjenvey | set | nosy:
+ pjenvey messages:
+ msg3601 |
2008-09-15 17:45:32 | ericjacobs | create | |
|