-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(base): implement dunder methods
- Loading branch information
Showing
6 changed files
with
356 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
return { | ||
local M = {} | ||
|
||
---@enum PathlibPathEnum | ||
M.path_module_enum = { | ||
PathlibPath = "PathlibPath", | ||
PathlibPosix = "PathlibPosix", | ||
PathlibWindows = "PathlibWindows", | ||
} | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
local M = {} | ||
|
||
---Raise ValueError | ||
---@param func_name string # function name where error is raised | ||
---@param object any # Object with wrong value. | ||
M.value_error = function(func_name, object) | ||
local type_msg = type(object) | ||
if type(object) == "table" then | ||
type_msg = type_msg .. (" (mytype=%s)"):format(object.mytype) | ||
end | ||
error(("PathlibPath: ValueError: %s called against unknown type: %s"):format(func_name, type_msg), 2) | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.