Replies: 1 comment 4 replies
-
@toy Thanks for asking this question. This behavior dates back to 2009 (faca48a), and I concede it's not documented (although it does have test coverage). I think what you're suggesting would be an improvement. While I think there's a chance this change would break some applications, that likelihood feels small to me, and it would be easy to fix (change Would you be interested in drafting a pull request with the new behavior? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Normally I expect
open
method to initialise something, yield it, ensure closing and return result of block. For example forFile
I will get 10 bytes from/dev/zero
in result variable:This is not the case for
SQLite3::Database.open
, as it is an alias to method new, so when called with block, it will return the already closed instance ofSQLite3::Database
instead of block result.Is there a reason not to return block result? Otherwise what do you think about changing this? From one side it is a breaking change, as someone maybe relying on it, from the other side - it is not explicitly documented that open will not return block result when called with block.
Beta Was this translation helpful? Give feedback.
All reactions