You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will make any reference to the Fable library point to a package in the Python search path (e.g., site-packages) instead of the normally bundled library. Your package will then need to declare `fable-library` as a dependency so users can install it from PyPI.
Without `ClassAttributes`, members would be generated as properties with instance backing.
398
528
399
529
## `[<Erase>]`
400
530
401
531
### Erased unions
402
532
403
533
You can decode a type with `[<Erase>]` to tells fable to not emit code for that type.
404
534
405
-
This is useful for creating DSL for examples or when trying to represent a virtual type
535
+
This is useful for creating DSL for examples or when trying to represent a virtual type
406
536
for which you don't want to impact the size of the generated code.
407
537
408
538
```fs
@@ -472,13 +602,13 @@ let test(arg: U3<string, int, float[]>) =
472
602
// to_console(printf("An int %i"))(arg)
473
603
// elif is_array_like(arg):
474
604
// to_console(printf("An array with sum %f"))(arg)
475
-
// else:
605
+
// else:
476
606
// to_console(printf("A string %s"))(arg)
477
607
```
478
608
479
609
### Erased types
480
610
481
-
Decoring a type with `[<Erase>]` allows you to instruct Fable to not generate any code for that type. This is useful when you want to use a type from a Python library that you don't want to generate bindings for.
611
+
Decorating a type with `[<Erase>]` allows you to instruct Fable to not generate any code for that type. This is useful when you want to use a type from a Python library that you don't want to generate bindings for.
482
612
483
613
```fs
484
614
open Fable.Core
@@ -555,7 +685,7 @@ The generated code is much smaller and doesn't include any reflection informatio
555
685
556
686
## `[<StringEnum>]`
557
687
558
-
:::info
688
+
:::info
559
689
These union types must not have any data fields as they will be compiled to a string matching the name of the union case.
560
690
:::
561
691
@@ -585,7 +715,7 @@ on_event("click", ignore)
585
715
586
716
### `CaseRules`
587
717
588
-
`StringEnum` accept a parameters allowing you to control the casing used to conver the union case name to a string.
718
+
`StringEnum` accept a parameters allowing you to control the casing used to convert the union case name to a string.
@@ -681,7 +811,7 @@ You then need to set each field manually.
681
811
open Fable.Core
682
812
open Fable.Core.PyInterop
683
813
684
-
type IUser =
814
+
type IUser =
685
815
abstract Name : string with get, set
686
816
abstract Age : int with get, set
687
817
@@ -801,7 +931,7 @@ class MinStack:
801
931
Added in v3.2.0
802
932
</p>
803
933
804
-
If you are not planning to use an interface to interact with Python and want to have overloaded members, you can decorate the interface declaration with the `Mangle` attribute.
934
+
If you are not planning to use an interface to interact with Python and want to have overloaded members, you can decorate the interface declaration with the `Mangle` attribute.
805
935
806
936
> Interfaces coming from .NET BCL (like System.Collections.IEnumerator) are mangled by default.
0 commit comments