Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for Operator (0.46 sec)

  1. fastapi/encoders.py

        Our Id type is a prime example of this.
    
        >>> decimal_encoder(Decimal("1.0"))
        1.0
    
        >>> decimal_encoder(Decimal("1"))
        1
        """
        if dec_value.as_tuple().exponent >= 0:  # type: ignore[operator]
            return int(dec_value)
        else:
            return float(dec_value)
    
    
    ENCODERS_BY_TYPE: Dict[Type[Any], Callable[[Any], Any]] = {
        bytes: lambda o: o.decode(),
        Color: str,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
Back to top