1- // PythonScript Runtime - regenerated on: Tue Nov 26 17:16:46 2013
1+ // PythonScript Runtime - regenerated on: Wed Nov 27 17:19:14 2013
22__NULL_OBJECT__ = Object . create ( null ) ;
33if ( ( "window" ) in this && ( "document" ) in this ) {
44 __NODEJS__ = false ;
@@ -1101,6 +1101,17 @@ _setup_array_prototype = function(args, kwargs) {
11011101 func . kwargs_signature = { } ;
11021102 func . types_signature = { } ;
11031103 Array . prototype . append = func ;
1104+ var func = function ( item ) {
1105+ var index ;
1106+ index = this . indexOf ( item ) ;
1107+ this . splice ( index , 1 ) ;
1108+ }
1109+
1110+ func . NAME = "func" ;
1111+ func . args_signature = [ "item" ] ;
1112+ func . kwargs_signature = { } ;
1113+ func . types_signature = { } ;
1114+ Array . prototype . remove = func ;
11041115 var func = function ( x , low , high ) {
11051116 var high , a , low , mid ;
11061117 if ( ( low ) === undefined ) {
@@ -1126,6 +1137,43 @@ _setup_array_prototype = function(args, kwargs) {
11261137 func . kwargs_signature = { } ;
11271138 func . types_signature = { } ;
11281139 Array . prototype . bisect = func ;
1140+ var func = function ( other ) {
1141+ return this . filter ( ( function ( i ) { return other . indexOf ( i ) == - 1 } ) ) ;
1142+ }
1143+
1144+ func . NAME = "func" ;
1145+ func . args_signature = [ "other" ] ;
1146+ func . kwargs_signature = { } ;
1147+ func . types_signature = { } ;
1148+ Array . prototype . difference = func ;
1149+ var func = function ( other ) {
1150+ return this . filter ( ( function ( i ) { return other . indexOf ( i ) != - 1 } ) ) ;
1151+ }
1152+
1153+ func . NAME = "func" ;
1154+ func . args_signature = [ "other" ] ;
1155+ func . kwargs_signature = { } ;
1156+ func . types_signature = { } ;
1157+ Array . prototype . intersection = func ;
1158+ var func = function ( other ) {
1159+ var iter = this ;
1160+
1161+ if ( ! ( iter instanceof Array ) ) { iter = __object_keys__ ( iter ) }
1162+ for ( var item = 0 ; item < iter . length ; item ++ ) {
1163+ var backup = item ; item = iter [ item ] ;
1164+ if ( ( other . indexOf ( item ) ) == - 1 ) {
1165+ return false ;
1166+ }
1167+ item = backup ;
1168+ }
1169+ return true ;
1170+ }
1171+
1172+ func . NAME = "func" ;
1173+ func . args_signature = [ "other" ] ;
1174+ func . kwargs_signature = { } ;
1175+ func . types_signature = { } ;
1176+ Array . prototype . issubset = func ;
11291177}
11301178
11311179_setup_array_prototype . NAME = "_setup_array_prototype" ;
@@ -1614,6 +1662,25 @@ __tuple___len__.kwargs_signature = { };
16141662__tuple___len__ . types_signature = { } ;
16151663__tuple___len__ . pythonscript_function = true ;
16161664__tuple_attrs [ "__len__" ] = __tuple___len__ ;
1665+ __tuple_length__getprop__ = function ( args , kwargs ) {
1666+ if ( args instanceof Array && { } . toString . call ( kwargs ) === '[object Object]' && ( arguments . length ) == 2 ) {
1667+ /*pass*/
1668+ } else {
1669+ args = Array . prototype . slice . call ( arguments ) ;
1670+ kwargs = Object ( ) ;
1671+ }
1672+ var signature , arguments ;
1673+ signature = { "kwargs" : Object ( ) , "args" : __create_array__ ( "self" ) } ;
1674+ arguments = get_arguments ( signature , args , kwargs ) ;
1675+ var self = arguments [ 'self' ] ;
1676+ return self [ "$wrapped" ] . length ;
1677+ }
1678+
1679+ __tuple_length__getprop__ . NAME = "__tuple_length__getprop__" ;
1680+ __tuple_length__getprop__ . args_signature = [ "self" ] ;
1681+ __tuple_length__getprop__ . kwargs_signature = { } ;
1682+ __tuple_length__getprop__ . types_signature = { } ;
1683+ __tuple_length__getprop__ . pythonscript_function = true ;
16171684__tuple_index = function ( args , kwargs ) {
16181685 if ( args instanceof Array && { } . toString . call ( kwargs ) === '[object Object]' && ( arguments . length ) == 2 ) {
16191686 /*pass*/
@@ -1714,6 +1781,8 @@ __tuple___contains__.kwargs_signature = { };
17141781__tuple___contains__ . types_signature = { } ;
17151782__tuple___contains__ . pythonscript_function = true ;
17161783__tuple_attrs [ "__contains__" ] = __tuple___contains__ ;
1784+ __tuple_properties [ "length" ] = Object ( ) ;
1785+ __tuple_properties [ "length" ] [ "get" ] = __tuple_length__getprop__ ;
17171786tuple = create_class ( "tuple" , __tuple_parents , __tuple_attrs , __tuple_properties ) ;
17181787var list , __list_attrs , __list_parents ;
17191788__list_attrs = Object ( ) ;
@@ -2146,6 +2215,25 @@ __list___len__.kwargs_signature = { };
21462215__list___len__ . types_signature = { } ;
21472216__list___len__ . pythonscript_function = true ;
21482217__list_attrs [ "__len__" ] = __list___len__ ;
2218+ __list_length__getprop__ = function ( args , kwargs ) {
2219+ if ( args instanceof Array && { } . toString . call ( kwargs ) === '[object Object]' && ( arguments . length ) == 2 ) {
2220+ /*pass*/
2221+ } else {
2222+ args = Array . prototype . slice . call ( arguments ) ;
2223+ kwargs = Object ( ) ;
2224+ }
2225+ var signature , arguments ;
2226+ signature = { "kwargs" : Object ( ) , "args" : __create_array__ ( "self" ) } ;
2227+ arguments = get_arguments ( signature , args , kwargs ) ;
2228+ var self = arguments [ 'self' ] ;
2229+ return self [ "$wrapped" ] . length ;
2230+ }
2231+
2232+ __list_length__getprop__ . NAME = "__list_length__getprop__" ;
2233+ __list_length__getprop__ . args_signature = [ "self" ] ;
2234+ __list_length__getprop__ . kwargs_signature = { } ;
2235+ __list_length__getprop__ . types_signature = { } ;
2236+ __list_length__getprop__ . pythonscript_function = true ;
21492237__list___contains__ = function ( args , kwargs ) {
21502238 if ( args instanceof Array && { } . toString . call ( kwargs ) === '[object Object]' && ( arguments . length ) == 2 ) {
21512239 /*pass*/
@@ -2171,6 +2259,8 @@ __list___contains__.kwargs_signature = { };
21712259__list___contains__ . types_signature = { } ;
21722260__list___contains__ . pythonscript_function = true ;
21732261__list_attrs [ "__contains__" ] = __list___contains__ ;
2262+ __list_properties [ "length" ] = Object ( ) ;
2263+ __list_properties [ "length" ] [ "get" ] = __list_length__getprop__ ;
21742264list = create_class ( "list" , __list_parents , __list_attrs , __list_properties ) ;
21752265var dict , __dict_attrs , __dict_parents ;
21762266__dict_attrs = Object ( ) ;
@@ -2550,7 +2640,7 @@ __dict___iter__.pythonscript_function = true;
25502640__dict_attrs [ "__iter__" ] = __dict___iter__ ;
25512641dict = create_class ( "dict" , __dict_parents , __dict_attrs , __dict_properties ) ;
25522642set = function ( args , kwargs ) {
2553- var h , arr ;
2643+ var s ;
25542644 if ( args instanceof Array && { } . toString . call ( kwargs ) === '[object Object]' && ( arguments . length ) == 2 ) {
25552645 /*pass*/
25562646 } else {
@@ -2561,38 +2651,25 @@ set = function(args, kwargs) {
25612651 signature = { "kwargs" : Object ( ) , "args" : __create_array__ ( "a" ) } ;
25622652 arguments = get_arguments ( signature , args , kwargs ) ;
25632653 var a = arguments [ 'a' ] ;
2564- arr = [ ] ;
2565- h = Object . create ( null ) ;
2654+ "\n Python docs say that set are unordered, yet when created from a list, \n it always moves the last item to the second element.\n " ;
2655+ s = [ ] ;
25662656 if ( isinstance ( a , list ) ) {
2567- var iter = a [ "$wrapped" ] ;
2568-
2569- if ( ! ( iter instanceof Array ) ) { iter = __object_keys__ ( iter ) }
2570- for ( var item = 0 ; item < iter . length ; item ++ ) {
2571- var backup = item ; item = iter [ item ] ;
2572- if ( ( item ) in h || Object . hasOwnProperty . call ( h , "__contains__" ) && h [ "__contains__" ] ( item ) ) {
2573- continue ;
2574- } else {
2575- h [ item ] = true ;
2576- arr . push ( item ) ;
2577- }
2578- item = backup ;
2579- }
2657+ b = a [ "$wrapped" ] . slice ( ) ;
25802658 } else {
2581- var iter = a ;
2659+ b = a . slice ( ) ;
2660+ }
2661+ b . splice ( 1 , 0 , b [ b . length - 1 ] ) ;
2662+ var iter = b ;
25822663
2583- if ( ! ( iter instanceof Array ) ) { iter = __object_keys__ ( iter ) }
2584- for ( var item = 0 ; item < iter . length ; item ++ ) {
2585- var backup = item ; item = iter [ item ] ;
2586- if ( ( item ) in h || Object . hasOwnProperty . call ( h , "__contains__" ) && h [ "__contains__" ] ( item ) ) {
2587- continue ;
2588- } else {
2589- h [ item ] = true ;
2590- arr . push ( item ) ;
2591- }
2592- item = backup ;
2664+ if ( ! ( iter instanceof Array ) ) { iter = __object_keys__ ( iter ) }
2665+ for ( var item = 0 ; item < iter . length ; item ++ ) {
2666+ var backup = item ; item = iter [ item ] ;
2667+ if ( ( s . indexOf ( item ) ) == - 1 ) {
2668+ s . push ( item ) ;
25932669 }
2670+ item = backup ;
25942671 }
2595- return arr ;
2672+ return s ;
25962673}
25972674
25982675set . NAME = "set" ;
0 commit comments