CodeFlag (Jython API documentation)
Date: 2024-08-18

org.python.core

## Enum CodeFlag

- java.lang.Object
- - java.lang.Enum<CodeFlag>
  - - org.python.core.CodeFlag

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CodeFlag>

      public enum CodeFlag
      extends java.lang.Enum<CodeFlag>

  Represents flags that can be set on code objects.
  Author:
    Tobias Ivarsson

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `CO_FUTURE_ABSOLUTE_IMPORT` Absolute import.
    `CO_FUTURE_DIVISION` Standard division of integers returns float, truncating division needs to be enforced.
    `CO_FUTURE_PRINT_FUNCTION` print function.
    `CO_FUTURE_UNICODE_LITERALS` unicode literals.
    `CO_FUTURE_WITH_STATEMENT` With statement.
    `CO_GENERATOR` The compiled code block is a generator code block.
    `CO_GENERATOR_ALLOWED` Denotes that generators are enabled in the code block.
    `CO_NESTED` Denotes that nested scopes are enabled in the code block.
    `CO_NEWLOCALS` Denotes that a new dictionary should be created for the code block.
    `CO_OPTIMIZED` Denotes that the code block uses fast locals.
    `CO_VARARGS` The compiled code block has a varargs argument.
    `CO_VARKEYWORDS` The compiled code block has a varkeyword argument.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `flag`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isFlagBitSetIn(int flags)`
    `static CodeFlag` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static CodeFlag[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### CO_OPTIMIZED

          public static final CodeFlag CO_OPTIMIZED

      Denotes that the code block uses fast locals.

    - #### CO_NEWLOCALS

          public static final CodeFlag CO_NEWLOCALS

      Denotes that a new dictionary should be created for the code block.

    - #### CO_VARARGS

          public static final CodeFlag CO_VARARGS

      The compiled code block has a varargs argument.

    - #### CO_VARKEYWORDS

          public static final CodeFlag CO_VARKEYWORDS

      The compiled code block has a varkeyword argument.

    - #### CO_GENERATOR

          public static final CodeFlag CO_GENERATOR

      The compiled code block is a generator code block.

    - #### CO_NESTED

          public static final CodeFlag CO_NESTED

      Denotes that nested scopes are enabled in the code block.

    - #### CO_GENERATOR_ALLOWED

          public static final CodeFlag CO_GENERATOR_ALLOWED

      Denotes that generators are enabled in the code block.

    - #### CO_FUTURE_DIVISION

          public static final CodeFlag CO_FUTURE_DIVISION

      Standard division of integers returns float, truncating division needs to be enforced.

    - #### CO_FUTURE_ABSOLUTE_IMPORT

          public static final CodeFlag CO_FUTURE_ABSOLUTE_IMPORT

      Absolute import.

    - #### CO_FUTURE_WITH_STATEMENT

          public static final CodeFlag CO_FUTURE_WITH_STATEMENT

      With statement.

    - #### CO_FUTURE_PRINT_FUNCTION

          public static final CodeFlag CO_FUTURE_PRINT_FUNCTION

      print function.

    - #### CO_FUTURE_UNICODE_LITERALS

          public static final CodeFlag CO_FUTURE_UNICODE_LITERALS

      unicode literals.

  - ### Field Detail

    - #### flag

          public final int flag

  - ### Method Detail

    - #### values

          public static CodeFlag[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (CodeFlag c : CodeFlag.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static CodeFlag valueOf(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null

    - #### isFlagBitSetIn

          public boolean isFlagBitSetIn(int flags)

Jython homepage