# Findmin/max and generators

**URL:** <https://discourse.julialang.org/t/findmin-max-and-generators/88473>\
**Category:** General Usage\
**Created:** [October 9, 2022, 10:33am UTC](https://discourse.julialang.org/t/findmin-max-and-generators/88473 "2022-10-09T10:33:43Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)\
**Post date:** [October 9, 2022, 10:33am UTC](https://discourse.julialang.org/t/findmin-max-and-generators/88473/1 "2022-10-09T10:33:43Z")

</div>

I noticed the following oddity

```julia
println(findmin(identity, x for x in [3, 2, 1]))
println(findmin(identity, x for x in [3, 2, 1] if x != 1))

```

showing

```julia
(1, 3)
ERROR: MethodError: no method matching keys(::Base.Iterators.Filter{var"#9#10", Vector{Int64}})

```

Do you know an easy fix for this?

---

_[View the full topic](https://discourse.julialang.org/t/findmin-max-and-generators/88473)._
