struct
Report an issueopen_in_new
View sourceopen_in_new
Nightly
8.1
·
8.0
·
7.5
·
7.4
·
7.3
·
7.2
A generic object with fields.
Structs fields cannot be reassigned once the struct is created. Two structs are equal if they have the same fields and if corresponding field values are equal.
Members
struct
struct struct(**kwargs)
Creates an immutable struct using the keyword arguments as attributes. It is used to group multiple values together. Example:
s = struct(x = 2, y = 3)
return s.x + getattr(s, "y") # returns 5
Parameters
Parameter |
Description |
kwargs
|
default is {}
Dictionary of arguments.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-13 UTC.
[null,null,["Last updated 2025-02-13 UTC."],[],[]]