![]() ![]() Joins the string items in a XList with the delimiter string between each XList item and returns a string (or unicode) type. Return a set with the items in XList that are also contained in the parameter test_list. Other_object ( object) – an object that is to be tested for equality Equality testing is defined by meeting the criteria: (1) the type of the XList and the other_object are the same (2) the list item values in the XList and the other_object are the same (3) the attribute metadata (if present) are the same in the XList and the other_object. The = operator can also be used to perform this test between the left ( XList) and right ( other_object) sided operands. The equals() method performs equality testing between a XList and another object. Test_list ( list) – a XList or list that is to be tested against Return a set with the items in the XList that are not contained in the parameter test_list. ( int) returns the count of duplicate items See remove_duplicates() to remove the duplicated items. ( XList) returns a XList with the above modificationsĬount the number of duplicate items in the XList. If the function does not return a value, the item is replaced with None. The return value is used as the replacement value in the XList. map_func ( function) – the function that is conditionally executed with the XList item as a parameter.conditional_func ( function) – a function that returns a boolean value where True means that the map_func should be executed on the item.See map_to_items() if you would like to map a function to every item in the list. Map a function map_func to items in a XList that meet a True condition in the function, conditional_func. XList Methods conditional_map_to_items ( conditional_func, map_func ) ¶ ( boolean) True = conditions for equality are not met False = conditions for equality are met The != operator is overloaded to return the negation of the test for equality as it is defined in the equals() method below. ( boolean) True = conditions for equality are met False = conditions for equality are not met The = operator is overloaded to perform equality testing as defined for the equals() method below. ( XList) returns the original XList extended with data in the other_list as defined above Other_list ( list) – a Python list or XList The right sided XList operand attribute values take precendence when the same attribute is included in both XLists. When used with another XList, the original XList is extended with the items and the attributes in the other XList. When used with a Python list, the XList is extended with the items in the list. The XList must be the left sided operand in your statement to use this overloaded operator. The += operator is overloaded to extend the XList with another XList or list. ( XList) returns the original XList extended with data in the *other_lists as defined above can add multiple XLists: xl = xl1 + xl2 + xl3) Other_lists ( list) – one or more Python lists or XList (i.e. The + operator is overloaded to extend the XList with one or more other XLists or lists. Overloaded Operators _add_ ( *other_lists ) ¶ Key names are mapped to attribute names and their corresponding values are mapped to the attribute values. ![]() attribute_dictionary ( dictionary) – ( optional) a Python dictionary that is used to define the attributes of a new instance of a XList.This can be of any Python sequence type, including sets, tuples, and other lists. the_list ( list) – the data that are used to create an instance of a XList list.The metadata are stored as attributes on the XList with dictionary keys mapped to attribute names and dictionary values mapped to the corresponding attribute values. You have the option to include a Python dictionary as a second parameter to include additional metadata. XList ( the_list ) ¶Ī XList is instantiated with any Python sequence type, including sets, tuples, and other lists. You can use the = and != operators to perform this testing (or alternatively, the XList.equals() method). The XList supports equality testing based upon both the values of the list items as well as the supplemental XList metadata (if included). It extends the built-in Python list type with operator overloads, metadata definitions on instantiation, preservation of metadata on conversion to other types (with included XList methods), and a number of additional list methods. You can use all built-in Python list methods with it. The XList class is an extension of the Python list type. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |