Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezones should broadcast as scalars #175

Closed
oxinabox opened this issue Jan 17, 2019 · 3 comments
Closed

Timezones should broadcast as scalars #175

oxinabox opened this issue Jan 17, 2019 · 3 comments

Comments

@oxinabox
Copy link
Contributor

In julia 1.0 broadcasting defaults to iterating.

So if you do say

ZonedDateTime.([now(), now(), now()], tz"UTC")

you get the error

MethodError: no method matching length(::FixedTimeZone)

The workaround is
ZonedDateTime.([now(), now(), now()], Ref(tz"UTC"))

Which works fine.

But since we take broadcasting seriously we should be able to set the broadcaststyle of an AbstractTimeZone to be scalar-like.
Then the original example will work

@iamed2
Copy link
Member

iamed2 commented Jan 17, 2019

Fixed in Julia 1.1: JuliaLang/julia#30159

@oxinabox
Copy link
Contributor Author

Is there a backport of it anywhere?
Maybe in Compat?

@iamed2
Copy link
Member

iamed2 commented Jan 17, 2019

I don't believe so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants