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

Replace some instances of 'typeof(a)<:b' by 'a isa b' #3177

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function _eval_poly(E::Number, vars)
end

function eval_poly(s::String, R)
if typeof(R) <: Union{PolyRing, MPolyRing}
if R isa Union{PolyRing, MPolyRing}
symR = symbols(R) # Symbol[]
genR = gens(R)
else
Expand Down
2 changes: 1 addition & 1 deletion experimental/Schemes/IdealSheaves.jl
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ function order_on_divisor(
# L, map = localization(OO(U),
# MPolyComplementOfPrimeIdeal(saturated_ideal(I(U)))
# )
# typeof(L)<:Union{MPolyLocRing{<:Any, <:Any, <:Any, <:Any,
# L isa Union{MPolyLocRing{<:Any, <:Any, <:Any, <:Any,
# <:MPolyComplementOfPrimeIdeal},
# MPolyQuoLocRing{<:Any, <:Any, <:Any, <:Any,
# <:MPolyComplementOfPrimeIdeal}
Expand Down
4 changes: 2 additions & 2 deletions src/AlgebraicGeometry/Schemes/Glueing/Constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ given by the pullback function
u -> 1/x
v -> y/x

julia> typeof(G)<:SimpleGlueing # Since the glueing domains were `PrincipalOpenSubsets`, this defaults to a `SimpleGlueing`
julia> G isa SimpleGlueing # Since the glueing domains were `PrincipalOpenSubsets`, this defaults to a `SimpleGlueing`
true

julia> # Alternative using SpecOpens as glueing domains:
Expand All @@ -59,7 +59,7 @@ defined by the map
u -> 1/x
v -> y/x

julia> typeof(H)<:Glueing
julia> H isa Glueing
true
```
"""
Expand Down
4 changes: 2 additions & 2 deletions src/Rings/mpoly-localizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2452,7 +2452,7 @@ function coordinates(
return transpose(T * transpose(L(one(R), denominator(a), check=false)*map_entries(L, coordinates(numerator(a), pre_saturated_ideal(I)))))
end

i = findfirst(x->(typeof(x)<:MPolyPowersOfElement), U)
i = findfirst(x->(x isa MPolyPowersOfElement), U)
if !isnothing(i)
if !has_attribute(I, :popped_ideal)
S = popat!(U, i)
Expand Down Expand Up @@ -2514,7 +2514,7 @@ function ideal_membership(

numerator(a) in pre_saturated_ideal(I) && return true

i = findfirst(x->(typeof(x)<:MPolyPowersOfElement), U)
i = findfirst(x->(x isa MPolyPowersOfElement), U)
if !isnothing(i)
if !has_attribute(I, :popped_ideal)
S = popat!(U, i)
Expand Down
2 changes: 1 addition & 1 deletion src/Rings/mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ end

function oscar_assure(B::BiPolyArray)
if !isdefined(B, :O) || !isassigned(B.O, 1)
if typeof(B.Ox) <: MPolyQuoRing
if B.Ox isa MPolyQuoRing
R = oscar_origin_ring(B.Ox)
else
R = B.Ox
Expand Down
2 changes: 1 addition & 1 deletion test/Groups/conformance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import Oscar.AbstractAlgebra.GroupsCore
end

@testset "Comparison methods" begin
if typeof(G) isa PermGroup
if G isa PermGroup
@test (g==h) isa Bool
@test isequal(g,h) isa Bool
@test g == g
Expand Down