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

[[.stringr_pattern method not defined #529

Closed
mkoohafkan opened this issue Oct 30, 2023 · 1 comment · Fixed by #569
Closed

[[.stringr_pattern method not defined #529

mkoohafkan opened this issue Oct 30, 2023 · 1 comment · Fixed by #569
Labels
feature a feature request or enhancement tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day

Comments

@mkoohafkan
Copy link

Method [.stringr_pattern is defined, but [[.stringr_pattern is not:

ex = coll(c("foo", "bar"))
ex[1]
#> [1] "foo"
#> attr(,"options")
#> attr(,"options")$locale
#> [1] "en"
#> 
#> attr(,"options")$strength
#> [1] 3
#> 
#> attr(,"class")
#> [1] "stringr_coll"    "stringr_pattern" "character"   
class(ex[1])
#> [1] "stringr_coll"    "stringr_pattern" "character" 

ex[[1]]
#> [1] "foo"
class(ex[[1]])
#> [1] "character"

Is this by design?

@hadley hadley added the feature a feature request or enhancement label Oct 31, 2023
@hadley hadley added the tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day label Jul 15, 2024
@hadley
Copy link
Member

hadley commented Jul 15, 2024

Agreed that this would be nice to have.

If someone works on this for TDD, it'll need a simple S3 method (you can copy [.stringr_pattern), a test, and a news bullet.

edward-burn added a commit to edward-burn/stringr that referenced this issue Aug 15, 2024
closes tidyverse#529

copy of [.stringr_pattern with simple test added for both
@hadley hadley closed this as completed in 6f85a06 Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants