Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/Fable.Cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

* [Python] Fix regression `%A` format specifier to output booleans as lowercase `true`/`false` (by @dbrattli)

## 5.0.0-alpha.19 - 2025-12-04

### Fixed
Expand All @@ -15,8 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

* [Python] Add support for `[<Py.Decorate>]` attribute on methods (previously only worked on classes)
* [Python] Add new `[<Py.ClassMethod>]` attribute to emit @classmethod instead of @staticmethod
* [Python] Add support for `[<Py.Decorate>]` attribute on methods (previously only worked on classes) (by @dbrattli)
* [Python] Add new `[<Py.ClassMethod>]` attribute to emit @classmethod instead of @staticmethod (by @dbrattli)
* [Python] Added support for Pydantic serialization of core numeric and array types (by @dbrattli)

## 5.0.0-alpha.18 - 2025-12-03
Expand Down
8 changes: 6 additions & 2 deletions src/Fable.Compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

* [Python] Fix regression `%A` format specifier to output booleans as lowercase `true`/`false` (by @dbrattli)

## 5.0.0-alpha.18 - 2025-12-04

### Fixed
Expand All @@ -15,8 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

* [Python] Add support for `[<Py.Decorate>]` attribute on methods (previously only worked on classes)
* [Python] Add new `[<Py.ClassMethod>]` attribute to emit @classmethod instead of @staticmethod
* [Python] Add support for `[<Py.Decorate>]` attribute on methods (previously only worked on classes) (by @dbrattli)
* [Python] Add new `[<Py.ClassMethod>]` attribute to emit @classmethod instead of @staticmethod (by @dbrattli)
* [Python] Added support for Pydantic serialization of core numeric and array types (by @dbrattli)

## 5.0.0-alpha.17 - 2025-12-03
Expand Down
4 changes: 2 additions & 2 deletions src/Fable.Core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

* [Python] Add support for [<Py.Decorate>] attribute on methods (previously only worked on classes)
* [Python] Add new [<Py.ClassMethod>] attribute to emit @classmethod instead of @staticmethod
* [Python] Add support for [<Py.Decorate>] attribute on methods (previously only worked on classes) (by @dbrattli)
* [Python] Add new [<Py.ClassMethod>] attribute to emit @classmethod instead of @staticmethod (by @dbrattli)

## 5.0.0-beta.2 - 2025-11-19

Expand Down
8 changes: 8 additions & 0 deletions src/fable-library-py/src/strings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ mod printf {
"Int64" => format!("{}:i64", arg.str()?),
"UInt32" => format!("{}:u32", arg.str()?),
"UInt64" => format!("{}:u64", arg.str()?),
// Handle booleans with F# lowercase representation (true/false)
"bool" => {
if arg.is_truthy()? {
TRUE_STR.to_string()
} else {
FALSE_STR.to_string()
}
}
_ => arg.str()?.to_string(),
}
};
Expand Down
13 changes: 13 additions & 0 deletions tests/Python/TestString.fs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ let ``test Extended string interpolation syntax`` () =
let cssNew = $$""".{{classAttr}}:hover {background-color: #eee;}"""
cssNew |> equal ".item-panel:hover {background-color: #eee;}"

[<Fact>]
let ``test sprintf \"%A\" formats booleans as lowercase`` () =
// Test that %A formats booleans as lowercase true/false (F# semantics)
let result = sprintf "%A" true
equal "true" result

let result2 = sprintf "%A" false
equal "false" result2

// Also test in composed context
let optResult = sprintf "Some(%A)" true
equal "Some(true)" optResult

[<Fact>]
let ``test sprintf \"%A\" with lists works`` () =
let xs = ["Hi"; "Hello"; "Hola"]
Expand Down
Loading