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

Rename one_or_zero #20

Closed
dowski opened this Issue Aug 15, 2013 · 4 comments

Comments

Projects
None yet
3 participants
@dowski

dowski commented Aug 15, 2013

postgres.py is a great library. one_or_zero is a bad method name.

It does not return 0.

one_or_none would be better.

Or maybe just one. It's a nice reflection of all.

Or maybe if you want to give Haskellites warm-fuzzies (if they get warm-fuzzies).

Or if you really like one_or_zero then I'll open a ticket to rename all to all_or_nothing. ;-)

@tshepang

This comment has been minimized.

Show comment
Hide comment
@tshepang

tshepang Aug 15, 2013

Contributor

I agree, this is an ugly method name. I also like one, even if it used to mean something else (evolutionary baggage). It's nice and short.

Contributor

tshepang commented Aug 15, 2013

I agree, this is an ugly method name. I also like one, even if it used to mean something else (evolutionary baggage). It's nice and short.

@chadwhitacre

This comment has been minimized.

Show comment
Hide comment
@chadwhitacre

chadwhitacre Aug 19, 2013

Owner

I'm open to changing this. As @tshepang notes the reason it's called one_or_zero is largely historical accident. I'm fine with using one.

Would we then rename the zero keyword argument to default?

Owner

chadwhitacre commented Aug 19, 2013

I'm open to changing this. As @tshepang notes the reason it's called one_or_zero is largely historical accident. I'm fine with using one.

Would we then rename the zero keyword argument to default?

@tshepang

This comment has been minimized.

Show comment
Hide comment
@tshepang

tshepang Aug 19, 2013

Contributor

default makes sense

Contributor

tshepang commented Aug 19, 2013

default makes sense

chadwhitacre added a commit that referenced this issue Aug 20, 2013

chadwhitacre added a commit that referenced this issue Aug 20, 2013

Change record_type to back_as; #20
Decided on this one with @dowski. I wanted something shorter and
punchier, he was reading record as a verb.

https://botbot.me/freenode/aspen/msg/5326310/
@chadwhitacre

This comment has been minimized.

Show comment
Hide comment
@chadwhitacre

chadwhitacre Aug 20, 2013

Owner

Long IRC convo with @dowski on these API tweaks:

https://botbot.me/freenode/aspen/msg/5326266/

Owner

chadwhitacre commented Aug 20, 2013

Long IRC convo with @dowski on these API tweaks:

https://botbot.me/freenode/aspen/msg/5326266/

chadwhitacre referenced this issue Aug 20, 2013

Rename get_transaction to get_cursor
This keeps us closer to the DB-API 2.0 object model, where there is no
transaction object per se. Rather a transaction is a function of the way
the connection object underlying a cursor is used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment