Closed benmkw closed 1 year ago
GlobalsBuilder::new().build()
creates empty globals. I'm not sure this ever worked.
P.S. Next time when reporting bugs, please include full error. I think message (which is omitted) states that symbol is not resolved.
thanks for the quick response, GlobalsBuilder::extended_by
worked
I think message (which is omitted) states that symbol is not resolved.
somehow I only looked at the dialect type and thought that its settings would enable all the things because enable_types: DialectTypes::Enable
seemed to me like it would include e.g. starlark::environment::LibraryExtension::RecordType
but on second though thats of course not true cause it can be enabled with only custom types as well so these two settings are somewhat orthogonal.
on the other hand starlark::environment::LibraryExtension::Typing
seems like it is closely related to Dialect.enable_types
so maybe there is still an opportunity to unify both/ combine them somewhat
The idea is that LibraryExtension
is changing your standard library, whereas enable_types
is changing your parser. You can still write some types without the LibraryExtension
(e.g. str
), it's just things like typing.Any
that doesn't make a whole lot of sense without the other. I've created an internal patch to make each reference the other, which should be in the repo later today.
the following code does not work anymore:
rt = enum("one", "two")
and also
and
I saw a commit which changed
str.type
tostr
but could not find a way to enable it, probably I'm missing some basic config option?