[GH-ISSUE #48] Counter-intuitive naming #32

Open
opened 2026-02-26 01:32:57 +03:00 by kerem · 0 comments
Owner

Originally created by @sjbrown on GitHub (Oct 4, 2016).
Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/48

Originally assigned to: @jeffknupp on GitHub.

Hi, sorry for the brevity - just something I noticed that irked me:

error_message = is_valid_method(self.__model__, resource)

I would expect a functioned named is_valid_method(...) to return True if the endpoint usage was valid. Instead, if it returns an error_message (which evaluates to True), that indicates it wasn't a valid usage.

Maybe a name like validation_errors or validate_method would be more intuitive.

Originally created by @sjbrown on GitHub (Oct 4, 2016). Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/48 Originally assigned to: @jeffknupp on GitHub. Hi, sorry for the brevity - just something I noticed that irked me: `error_message = is_valid_method(self.__model__, resource)` I would expect a functioned named `is_valid_method(...)` to return `True` if the endpoint usage was valid. Instead, if it returns an `error_message` (which evaluates to `True`), that indicates it _wasn't_ a valid usage. Maybe a name like `validation_errors` or `validate_method` would be more intuitive.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/sandman2-jeffknupp#32
No description provided.