Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(346)

Unified Diff: src/org/python/core/PyFrozenSetDerived.java

Issue 2854: Coercion fix (Closed) Base URL: https://jython.svn.sourceforge.net/svnroot/jython/branches/asm
Patch Set: Updated to r5129 -- seems like rietveld is not happy with outdated patches Created 15 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/org/python/core/PyFloatDerived.java ('k') | src/org/python/core/PyInteger.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/org/python/core/PyFrozenSetDerived.java
===================================================================
--- src/org/python/core/PyFrozenSetDerived.java (revisiĆ³n: 5129)
+++ src/org/python/core/PyFrozenSetDerived.java (copia de trabajo)
@@ -1111,6 +1111,20 @@
return super.__tojava__(c);
}
+ public Object __coerce_ex__(PyObject o) {
+ PyType self_type=getType();
+ PyObject impl=self_type.lookup("__coerce__");
+ if (impl!=null) {
+ PyObject res=impl.__get__(this,self_type).__call__(o);
+ if (res==null||res==Py.None)
+ return res;
+ if (!(res instanceof PyTuple))
+ throw Py.TypeError("coercion should return None or 2-tuple");
+ return((PyTuple)res).getArray();
+ }
+ return super.__coerce_ex__(o);
+ }
+
public String toString() {
PyType self_type=getType();
PyObject impl=self_type.lookup("__repr__");
« no previous file with comments | « src/org/python/core/PyFloatDerived.java ('k') | src/org/python/core/PyInteger.java » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b