Skip to content

Commit e6c76a8

Browse files
committed
chore: use single quotes for the decorators
1 parent fcc6d7a commit e6c76a8

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Fable.Core/Fable.Core.Py.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,16 @@ module Py =
9595
/// as placeholders for the custom attribute's constructor arguments.</para>
9696
/// <para>Example - defining a custom decorator attribute:</para>
9797
/// <code>
98-
/// [&lt;Py.DecorateTemplate("app.get(\"{0}\")")&gt;]
98+
/// [&lt;Erase; Py.DecorateTemplate("app.get('{0}')")&gt;]
9999
/// type GetAttribute(path: string) = inherit Attribute()
100100
/// </code>
101101
/// <para>Example - using the custom decorator:</para>
102102
/// <code>
103103
/// [&lt;Get("/users")&gt;]
104104
/// static member get_users() = ...
105-
/// // Generates: @app.get("/users")
105+
/// // Generates: @app.get('/users')
106106
/// </code>
107+
/// <para>Use [&lt;Erase&gt;] to prevent the attribute class from being emitted to Python.</para>
107108
/// </remarks>
108109
[<AttributeUsage(AttributeTargets.Class)>]
109110
type DecorateTemplateAttribute(template: string) =

tests/Python/TestPyInterop.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,15 +730,15 @@ let app: obj = import "app" "./py/native_code.py"
730730

731731
// Custom decorator attributes using DecorateTemplate
732732
// Library authors define these once, users get clean syntax
733-
[<Erase; Py.DecorateTemplate("app.get(\"{0}\")")>]
733+
[<Erase; Py.DecorateTemplate("app.get('{0}')")>]
734734
type GetAttribute(path: string) =
735735
inherit Attribute()
736736

737-
[<Erase; Py.DecorateTemplate("app.post(\"{0}\")")>]
737+
[<Erase; Py.DecorateTemplate("app.post('{0}')")>]
738738
type PostAttribute(path: string) =
739739
inherit Attribute()
740740

741-
[<Erase; Py.DecorateTemplate("app.delete(\"{0}\")")>]
741+
[<Erase; Py.DecorateTemplate("app.delete('{0}')")>]
742742
type DeleteAttribute(path: string) =
743743
inherit Attribute()
744744

0 commit comments

Comments
 (0)