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
{{ message }}
Repository navigation
Kill +defaultPath in favor of just +default #11745
This is a discussion to decide if we should get rid of defaultPath and defaultAddress to just use default for everything. We should discuss context for why things are the way they are, blockers for making the change, and how the change would be implemented.
I'm trying to summarise my understanding of default vs defaultPath. Feel free to comment or fix what I'm saying. And maybe I'm missing some details.
We are trying to work on two different aspects at the same time:
a set of features we want every SDK to implement, for instance to have default values (and for this specific case, the default value for a directory is its path)
an experience as native as possible, each SDK should rely on the language possibilities
On Go SDK, default values are not something. So we came with pragma
In Python (and I guess in typescript) it means we are not using default pragma/annotation/decorator but relying on the default language capacities:
defecho(self, foo: str="bar") ->str:
echo(foo="bar"): string {
But this can't be applied the same way to complex types like directory: while the pragma in Go, specified as a comment, can be used to create the complex value, we can't have a complex type equals a string.
If we mix that with the "native way" with factories/helper I'm not seeing that working very well. Or it means the ignore must be an argument of the helper, like:
So the question that remains is to know if there is anything that really prevent us to rename defaultPath to default in python and typescript. If that's doable (and we can keep defaultPath for compatibility reasons for some time) then I'm not seeing any reason to not do it.
That way we can extend default across all languages to handle more cases, like the from of a container.
Note: on the typedef side, when we are registering the functions and their arguments, we can still keep withDefaultValue and withDefaultPath if that makes sense. The SDKs only can do the magic here. Or this is not an issue and we can also rely only on withDefaultValue, I haven't looked at this area.
Activity
eunomie commentedon Jan 27, 2026
I'm trying to summarise my understanding of
defaultvsdefaultPath. Feel free to comment or fix what I'm saying. And maybe I'm missing some details.We are trying to work on two different aspects at the same time:
On Go SDK, default values are not something. So we came with pragma
In Python (and I guess in typescript) it means we are not using
defaultpragma/annotation/decorator but relying on the default language capacities:But this can't be applied the same way to complex types like directory: while the pragma in Go, specified as a comment, can be used to create the complex value, we can't have a complex type equals a string.
This is not valid.
So we have a specific
defaultPathannotation:and basically the same thing in typescript:
With that, I'm seeing multiple ways to align that.
default, but keep it optional in the usage for simple typesMy concern with this option 2 is that we might still need some extra annotations and things will start to be more complexe:
If we mix that with the "native way" with factories/helper I'm not seeing that working very well. Or it means the
ignoremust be an argument of the helper, like:That's doable, but is it really better?
FTR Java is closer to Go here, with the usage of a default annotation:
So the question that remains is to know if there is anything that really prevent us to rename
defaultPathtodefaultin python and typescript. If that's doable (and we can keepdefaultPathfor compatibility reasons for some time) then I'm not seeing any reason to not do it.That way we can extend
defaultacross all languages to handle more cases, like thefromof a container.Note: on the typedef side, when we are registering the functions and their arguments, we can still keep
withDefaultValueandwithDefaultPathif that makes sense. The SDKs only can do the magic here. Or this is not an issue and we can also rely only onwithDefaultValue, I haven't looked at this area.