Skip to content

Conversation

@jameslamb
Copy link
Contributor

In this PR, I'd like to propose a minor change in the R package. I found two passes where typeof(x) == 'list or typeof(x) != 'list' is being used to check that something is a list.

This check isn't totally safe, since data.table or data.frame objects will pass this check.

typeof(data.frame())

[1] "list"

typeof(data.table::data.table())

[1] "list"

In this PR, I propose changing to a stricter check, identical(class(x)) == 'list'.

Thanks for your time and consideration!

@pommedeterresautee pommedeterresautee merged commit 4b7e2b7 into dmlc:master Mar 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
@jameslamb jameslamb deleted the r/class branch June 1, 2021 04:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants