Ugly shadowing of Client.DEFAULT_ENCODING_PARAMETERS #1847

Closed
opened 2012-11-08 01:49:22 +00:00 by davidsarah · 24 comments
davidsarah commented 2012-11-08 01:49:22 +00:00
Owner

Client in source:git/src/allmydata/client.py has a class attribute called DEFAULT_ENCODING_PARAMETERS, and an instance attribute also called DEFAULT_ENCODING_PARAMETERS that shadows it. This is ugly and confusing.

The linked pull request changes the name of the latter to _encoding_parameters.

`Client` in source:git/src/allmydata/client.py has a class attribute called `DEFAULT_ENCODING_PARAMETERS`, and an instance attribute also called `DEFAULT_ENCODING_PARAMETERS` that shadows it. This is ugly and confusing. The linked pull request changes the name of the latter to `_encoding_parameters`.
tahoe-lafs added the
code-encoding
minor
defect
1.9.2
labels 2012-11-08 01:49:22 +00:00
tahoe-lafs added this to the soon milestone 2012-11-08 01:49:22 +00:00
davidsarah commented 2012-11-08 02:11:38 +00:00
Author
Owner
(https://github.com/tahoe-lafs/tahoe-lafs/pull/18)
davidsarah commented 2012-11-08 16:19:01 +00:00
Author
Owner

Hmm, given the amount of test code that sets encoding parameters, it may be worth adding a set_encoding_parameters method to Client. So please hold off merging this.

Hmm, given the amount of test code that sets encoding parameters, it may be worth adding a `set_encoding_parameters` method to `Client`. So please hold off merging this.

Could this be related to #1830?

Could this be related to #1830?
daira commented 2013-06-20 11:40:04 +00:00
Author
Owner

Replying to zooko:

Could this be related to #1830?

No, see /tahoe-lafs/trac-2024-07-25/issues/6862#comment:-1.

Replying to [zooko](/tahoe-lafs/trac-2024-07-25/issues/1847#issuecomment-90068): > Could this be related to #1830? No, see [/tahoe-lafs/trac-2024-07-25/issues/6862](/tahoe-lafs/trac-2024-07-25/issues/6862)#[comment:-1](/tahoe-lafs/trac-2024-07-25/issues/1847#issuecomment--1).

#1830 is still bothering me (see comment:89856), and fixing this ticket would help because then I wouldn't be distracted by the nagging feeling that this ugly shadowing is somehow interacting with #1830. That is: fixing this ugly shadowing would help me think about #1830, even if the ugly shadowing is not actually causing #1830. ☺ (Or even if, as comment:89856 suggests, #1830 is actually already fixed!)

#1830 is still bothering me (see [comment:89856](/tahoe-lafs/trac-2024-07-25/issues/1830#issuecomment-89856)), and fixing this ticket would help because then I wouldn't be distracted by the nagging feeling that this ugly shadowing is somehow interacting with #1830. That is: fixing this ugly shadowing would help me think about #1830, even if the ugly shadowing is *not* actually causing #1830. ☺ (Or even if, as [comment:89856](/tahoe-lafs/trac-2024-07-25/issues/1830#issuecomment-89856) suggests, #1830 is actually already fixed!)
tahoe-lafs modified the milestone from soon to 1.11.0 2013-08-31 17:08:38 +00:00
daira commented 2013-08-31 17:09:46 +00:00
Author
Owner

Replying to zooko:

#1830 is still bothering me (see comment:89856), and fixing this ticket would help because then I wouldn't be distracted by the nagging feeling that this ugly shadowing is somehow interacting with #1830.

+1.

Replying to [zooko](/tahoe-lafs/trac-2024-07-25/issues/1847#issuecomment-90070): > #1830 is still bothering me (see [comment:89856](/tahoe-lafs/trac-2024-07-25/issues/1830#issuecomment-89856)), and fixing this ticket would help because then I wouldn't be distracted by the nagging feeling that this ugly shadowing is somehow interacting with #1830. +1.

comment:12:/tahoe-lafs/trac-2024-07-25/issues/5611 is an example of how this default/shadowing/fall-back code gets in the way of work.

comment:12:[/tahoe-lafs/trac-2024-07-25/issues/5611](/tahoe-lafs/trac-2024-07-25/issues/5611) is an example of how this default/shadowing/fall-back code gets in the way of work.
bazuka commented 2013-11-02 09:00:54 +00:00
Author
Owner

Hi I have made the changes, please review the changes.
review-needed:
https://github.com/tahoe-lafs/tahoe-lafs/pull/65

All test cases are green.

Hi I have made the changes, please review the changes. review-needed: <https://github.com/tahoe-lafs/tahoe-lafs/pull/65> All test cases are green.
daira commented 2013-11-03 18:48:34 +00:00
Author
Owner

[github comment here]copying

There's a cscope.out file that is added and then deleted. Please squash the last two commits so that this file doesn't appear and the commits are easier to review.

[github comment here]copying There's a `cscope.out` file that is added and then deleted. Please squash the last two commits so that this file doesn't appear and the commits are easier to review.
daira commented 2013-11-03 18:49:30 +00:00
Author
Owner

Also, the fix for this ticket should be independent of #549.

Also, the fix for this ticket should be independent of #549.
bazuka commented 2013-11-26 18:43:06 +00:00
Author
Owner
I have made the changes. Please review the code <https://github.com/basu123/tahoe-lafs/commit/8c1219f1ed582db1f00532bbf48715de08b1a8b9>
tahoe-lafs added
code
and removed
code-encoding
labels 2013-11-26 19:09:18 +00:00
daira commented 2013-11-26 19:23:26 +00:00
Author
Owner

This still has the cscope.out file. Also, when the indentation of the first line of a dict literal changes, please change the remaining lines to match.

This still has the `cscope.out` file. Also, when the indentation of the first line of a dict literal changes, please change the remaining lines to match.
tahoe-lafs added
code-encoding
and removed
code
labels 2013-11-26 19:23:26 +00:00
bazuka commented 2013-11-26 21:13:51 +00:00
Author
Owner
Hi Daira, I have made the changes. <https://github.com/basu123/tahoe-lafs/commit/51dcecd01a730f588ce439a013d19c67f8f131b9>
daira commented 2013-11-27 01:38:26 +00:00
Author
Owner

Reviewing.

Reviewing.
bazuka commented 2013-12-03 15:48:54 +00:00
Author
Owner

Replying to daira:
daira is there any changes I need to do?

Replying to [daira](/tahoe-lafs/trac-2024-07-25/issues/1847#issuecomment--1): daira is there any changes I need to do?
Author
Owner

reviewed code in last commit. seems fine to my (very fresh[!]) eyes...

reviewed code in last commit. seems fine to my (very fresh[!]) eyes...

I just reviewed this, too, comparing https://github.com/basu123/tahoe-lafs/commit/51dcecd01a730f588ce439a013d19c67f8f131b9#commitcomment-4763253 to https://github.com/daira/tahoe-lafs/commit/ab9216e5728083a671060ba12c98f56638f08517 . I had one question about a way that these two patches differ:

https://github.com/basu123/tahoe-lafs/commit/51dcecd01a730f588ce439a013d19c67f8f131b9#commitcomment-4763253

Also, wiki/CodingStandards says "Prepend a leading underscore to private names.", so the way https://github.com/daira/tahoe-lafs/commit/ab9216e5728083a671060ba12c98f56638f08517 did that is preferred.

Otherwise, I don't see any problem with either of these two patches and either one can be merged to trunk in my opinion.

I just reviewed this, too, comparing <https://github.com/basu123/tahoe-lafs/commit/51dcecd01a730f588ce439a013d19c67f8f131b9#commitcomment-4763253> to <https://github.com/daira/tahoe-lafs/commit/ab9216e5728083a671060ba12c98f56638f08517> . I had one question about a way that these two patches differ: <https://github.com/basu123/tahoe-lafs/commit/51dcecd01a730f588ce439a013d19c67f8f131b9#commitcomment-4763253> Also, [wiki/CodingStandards](wiki/CodingStandards) says "Prepend a leading underscore to private names.", so the way <https://github.com/daira/tahoe-lafs/commit/ab9216e5728083a671060ba12c98f56638f08517> did that is preferred. Otherwise, I don't see any problem with either of these two patches and either one can be merged to trunk in my opinion.

removing the review-needed flag

removing the `review-needed` flag

adding the "reviewed" flag to let it be known that either of these two branches could be merged to trunk.

adding the "reviewed" flag to let it be known that either of these two branches could be merged to trunk.
daira commented 2013-12-04 01:32:03 +00:00
Author
Owner

Replying to zooko:

Also, wiki/CodingStandards says "Prepend a leading underscore to private names.", so the way https://github.com/daira/tahoe-lafs/commit/ab9216e5728083a671060ba12c98f56638f08517 did that is preferred.

I disagree, because these attributes aren't private. (I count attributes as non-private if they are accessed directly from anywhere outside the class, including tests.) The patch looks fine to me in this respect; I had originally planned to add a method to set parameters, but I think it's not needed.

Replying to [zooko](/tahoe-lafs/trac-2024-07-25/issues/1847#issuecomment-90087): > Also, [wiki/CodingStandards](wiki/CodingStandards) says "Prepend a leading underscore to private names.", so the way <https://github.com/daira/tahoe-lafs/commit/ab9216e5728083a671060ba12c98f56638f08517> did that is preferred. I disagree, because these attributes aren't private. (I count attributes as non-private if they are accessed directly from anywhere outside the class, including tests.) The patch looks fine to me in this respect; I had originally planned to add a method to set parameters, but I think it's not needed.
Daira Hopwood <daira@jacaranda.org> commented 2014-04-21 21:52:48 +00:00
Author
Owner

In /tahoe-lafs/trac-2024-07-25/commit/4889129f3732219cb9cedb1eb27dec3da3f22db2:

Minor comment fix. refs #1847

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
In [/tahoe-lafs/trac-2024-07-25/commit/4889129f3732219cb9cedb1eb27dec3da3f22db2](/tahoe-lafs/trac-2024-07-25/commit/4889129f3732219cb9cedb1eb27dec3da3f22db2): ``` Minor comment fix. refs #1847 Signed-off-by: Daira Hopwood <daira@jacaranda.org> ```
daira commented 2014-04-21 22:05:56 +00:00
Author
Owner

Fixed by [77767e9e12cbd3e03f8ad917f6d3e8c1e4918c43/trunk]. (See #2231 for why that didn't show up here automatically.)

Fixed by [77767e9e12cbd3e03f8ad917f6d3e8c1e4918c43/trunk]. (See #2231 for why that didn't show up here automatically.)
tahoe-lafs added the
fixed
label 2014-04-21 22:05:56 +00:00
daira closed this issue 2014-04-21 22:05:56 +00:00
Daira Hopwood <daira@jacaranda.org> commented 2014-04-21 22:42:18 +00:00
Author
Owner

In /tahoe-lafs/trac-2024-07-25/commit/4889129f3732219cb9cedb1eb27dec3da3f22db2:

Minor comment fix. refs #1847

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
In [/tahoe-lafs/trac-2024-07-25/commit/4889129f3732219cb9cedb1eb27dec3da3f22db2](/tahoe-lafs/trac-2024-07-25/commit/4889129f3732219cb9cedb1eb27dec3da3f22db2): ``` Minor comment fix. refs #1847 Signed-off-by: Daira Hopwood <daira@jacaranda.org> ```
Daira Hopwood <daira@jacaranda.org> commented 2014-04-22 14:47:23 +00:00
Author
Owner

In /tahoe-lafs/trac-2024-07-25/commit/4889129f3732219cb9cedb1eb27dec3da3f22db2:

Minor comment fix. refs #1847

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
In [/tahoe-lafs/trac-2024-07-25/commit/4889129f3732219cb9cedb1eb27dec3da3f22db2](/tahoe-lafs/trac-2024-07-25/commit/4889129f3732219cb9cedb1eb27dec3da3f22db2): ``` Minor comment fix. refs #1847 Signed-off-by: Daira Hopwood <daira@jacaranda.org> ```
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#1847
No description provided.