diff --git a/lang/fr/typeshed/stdlib/microbit/uart.pyi b/lang/fr/typeshed/stdlib/microbit/uart.pyi index 479d6aa..71db4eb 100644 --- a/lang/fr/typeshed/stdlib/microbit/uart.pyi +++ b/lang/fr/typeshed/stdlib/microbit/uart.pyi @@ -29,7 +29,7 @@ For more details see `the online documentation bool: - """Check if any data is waiting. + """Vérifie si une donnée est en attente. Example: ``uart.any()`` diff --git a/lang/zh-tw/typeshed/stdlib/gc.pyi b/lang/zh-tw/typeshed/stdlib/gc.pyi index 32c6fc2..2883c12 100644 --- a/lang/zh-tw/typeshed/stdlib/gc.pyi +++ b/lang/zh-tw/typeshed/stdlib/gc.pyi @@ -16,7 +16,7 @@ def collect() -> None: ... def mem_alloc() -> int: - """獲取分配的堆積 RAM 的位元組。 (記憶體分配) + """取得分配的堆積 RAM 的位元組。 (記憶體分配) :return: The number of bytes allocated. @@ -24,7 +24,7 @@ This function is MicroPython extension.""" ... def mem_free() -> int: - """獲取可用堆積 RAM 的位元組,如果此數量未知,則為 -1。 + """取得可用堆積 RAM 的位元組,如果此數量未知,則為 -1。 :return: The number of bytes free. @@ -33,7 +33,7 @@ This function is MicroPython extension.""" @overload def threshold() -> int: - """查詢額外的GC分配閾值。 + """查詢其他 GC 分配閾值。 :return: The GC allocation threshold. diff --git a/lang/zh-tw/typeshed/stdlib/log.pyi b/lang/zh-tw/typeshed/stdlib/log.pyi index 4933e0e..a7ae428 100644 --- a/lang/zh-tw/typeshed/stdlib/log.pyi +++ b/lang/zh-tw/typeshed/stdlib/log.pyi @@ -1,18 +1,18 @@ """將資料記錄到您的 micro:bit V2。""" from typing import Literal, Optional, Union, overload MILLISECONDS = 1 -"""毫秒時間郵戳格式。""" +"""毫秒時間戳記格式。""" SECONDS = 10 -"""秒時間郵戳格式。""" +"""秒時間戳記格式。""" MINUTES = 600 -"""分鐘時間郵戳格式""" +"""分鐘時間戳記格式""" HOURS = 36000 -"""小時時間郵戳格式。""" +"""小時時間戳記格式。""" DAYS = 864000 -"""天時間郵戳格式。""" +"""天時間戳記格式。""" def set_labels(*args: str, timestamp: Optional[Literal[1, 10, 36000, 864000]]=SECONDS) -> None: - """設定記錄檔案標頭。 + """設定紀錄檔案標頭。 Example: ``log.set_labels('x', 'y', 'z', timestamp=log.MINUTES)`` @@ -24,9 +24,9 @@ labels set up by this function call to the last headers declared in the file. If the headers are different it will add a new header entry at the end of the file. -:param *args: 各記錄標頭的位置引數。 +:param *args: 各紀錄標頭的位置引數。 :param timestamp: (時間戳記) 將自動新增為每列第一行的時間郵戳單元。 -將此引數設定為 ``None``,則會停用時間郵戳。傳遞此模組定義的 ``log.MILLISECONDS``、``log.SECONDS``、``log.MINUTES``、``log.HOURS`` 或 ``log.DAYS`` 值。無效值將擲回例外狀況。""" +將此引數設定為 ``None``,則會停用時間戳記。傳遞此模組定義的 ``log.MILLISECONDS``、``log.SECONDS``、``log.MINUTES``、``log.HOURS`` 或 ``log.DAYS`` 值。無效值將擲回例外狀況。""" ... @overload @@ -44,12 +44,12 @@ entry to be added to the log with the extra label. Labels previously specified and not present in this function call will be skipped with an empty value in the log row. -:param log_data: 若要記錄為字典的資料,每個標頭都有一個金鑰。""" +:param log_data: 若要記錄為字典的資料,每個標頭都有一把金鑰。""" ... @overload def add(**kwargs: Union[str, int, float]) -> None: - """使用關鍵字引數將資料行新增至紀錄中。 + """使用關鍵字引數,將資料列新增至紀錄中。 Example: ``log.add(temp=temperature())`` @@ -71,16 +71,16 @@ Example: ``log.delete()`` To add the log headers the ``set_labels`` function has to be called again after this. -:param full: 選擇從快取記憶體中刪除資料的「完整」抹除格式。 -如果設定為 ``False`` 則會使用「快速」方法,該方法會使資料無效,而不是執行較慢的完全抹除。""" +:param full: 選擇從快閃存放裝置中移除資料的「完全」清除格式。 +如果設定為 ``False``,則會使用「快速」方法,該方法會使資料無效,而不是執行較慢的完全清除。""" ... def set_mirroring(serial: bool): - """將資料記錄活動鏡像到序列輸出。 + """將資料紀錄活動鏡像到序列輸出。 Example: ``log.set_mirroring(True)`` Mirroring is disabled by default. -:param serial: 傳遞 ``True`` 將資料記錄活動鏡像到序列輸出,``False`` 則停用鏡像。""" +:param serial: 傳遞 ``True`` 將資料紀錄活動鏡像到序列輸出,``False`` 則停用鏡像。""" ... \ No newline at end of file diff --git a/lang/zh-tw/typeshed/stdlib/machine.pyi b/lang/zh-tw/typeshed/stdlib/machine.pyi index 32864ad..d2bd797 100644 --- a/lang/zh-tw/typeshed/stdlib/machine.pyi +++ b/lang/zh-tw/typeshed/stdlib/machine.pyi @@ -3,7 +3,7 @@ from typing import Any from .microbit import MicroBitDigitalPin def unique_id() -> bytes: - """取得具有板的唯一識別碼之位元組字串。 + """取得具有開發板的唯一識別碼之位元組字串。 Example: ``machine.unique_id()`` @@ -40,7 +40,7 @@ def enable_irq(state: Any) -> None: Example: ``machine.enable_irq(interrupt_state)`` -:param state: 從最近一次叫用 ``disable_irq`` 函式傳回的值。""" +:param state: 從最近一次呼叫 ``disable_irq`` 函式傳回的值。""" ... def time_pulse_us(pin: MicroBitDigitalPin, pulse_level: int, timeout_us: int=1000000) -> int: @@ -56,7 +56,7 @@ starts straight away. :param pin: (引腳) 要使用的引腳 :param pulse_level: 0 到計時低脈衝或 1 到計時高脈衝 -:param timeout_us: 微秒超時 +:param timeout_us: 微秒逾時 :return: The duration of the pulse in microseconds, or -1 for a timeout waiting for the level to match ``pulse_level``, or -2 on timeout waiting for the pulse to end""" ... diff --git a/lang/zh-tw/typeshed/stdlib/math.pyi b/lang/zh-tw/typeshed/stdlib/math.pyi index e6ecb47..9bac332 100644 --- a/lang/zh-tw/typeshed/stdlib/math.pyi +++ b/lang/zh-tw/typeshed/stdlib/math.pyi @@ -11,7 +11,7 @@ Example: ``math.acos(1)`` ... def asin(x: float) -> float: - """計算反正弦值。 + """計算反正弦。 Example: ``math.asin(0)`` @@ -39,7 +39,7 @@ Example: ``math.atan2(0, -1)`` ... def ceil(x: float) -> float: - """將數字向正無限大捨入。 + """將數字向正無限大四捨五入。 Example: ``math.ceil(0.1)`` @@ -94,7 +94,7 @@ Example: ``math.fabs(-0.1)`` ... def floor(x: float) -> int: - """將數字向負無限大捨入。 + """將數字向負無限大四捨五入。 Example: ``math.floor(0.9)`` @@ -125,7 +125,7 @@ the relation ``0.5 <= abs(m) < 1`` holds. ... def isfinite(x: float) -> bool: - """檢查值是否是有限的。 + """檢查值是否為有限。 Example: ``math.isfinite(float('inf'))`` @@ -134,7 +134,7 @@ Example: ``math.isfinite(float('inf'))`` ... def isinf(x: float) -> bool: - """檢查值是否是無限的。 + """檢查值是否為無限。 Example: ``math.isinf(float('-inf'))`` @@ -143,7 +143,7 @@ Example: ``math.isinf(float('-inf'))`` ... def isnan(x: float) -> bool: - """檢查值是否不是數字 (NaN)。 + """檢查值是否為非數字 (NaN)。 Example: ``math.isnan(float('nan'))`` @@ -233,7 +233,7 @@ Example: ``math.tan(0)`` ... def trunc(x: float) -> int: - """將數字向 0 舍入。 + """將數字向 0 四捨五入。 Example: ``math.trunc(-0.9)`` diff --git a/lang/zh-tw/typeshed/stdlib/microbit/__init__.pyi b/lang/zh-tw/typeshed/stdlib/microbit/__init__.pyi index 044690d..db8c6b9 100644 --- a/lang/zh-tw/typeshed/stdlib/microbit/__init__.pyi +++ b/lang/zh-tw/typeshed/stdlib/microbit/__init__.pyi @@ -1,4 +1,4 @@ -"""引腳、影像、聲音、溫度和音量。""" +"""引腳、圖像、聲音、溫度和音量。""" from _typeshed import ReadableBuffer from typing import Any, Callable, List, Optional, overload from . import accelerometer as accelerometer @@ -12,7 +12,7 @@ from . import uart as uart from . import audio as audio def run_every(callback: Optional[Callable[[], None]]=None, days: int=0, h: int=0, min: int=0, s: int=0, ms: int=0) -> Callable[[Callable[[], None]], Callable[[], None]]: - """安排一個函式以指定的時間間隔叫用 **僅限 V2**。 + """安排一個函式,以指定的時間間隔呼叫 **僅限 V2**。 Example: ``run_every(my_logging, min=5)`` @@ -40,12 +40,12 @@ def panic(n: int) -> None: Example: ``panic(127)`` -:param n: 任意整數 <= 255 表示狀態。 +:param n: 任意整數 <= 255 以表示狀態。 Requires restart.""" def reset() -> None: - """重啟板子。""" + """重啟開發板。""" def sleep(n: float) -> None: """等待 ``n`` 毫秒。 @@ -61,7 +61,7 @@ One second is 1000 milliseconds, so:: will pause the execution for one second.""" def running_time() -> int: - """取得板子的執行時間。 + """取得開發板的執行時間。 :return: The number of milliseconds since the board was switched on or restarted.""" @@ -84,13 +84,13 @@ class Button: """按鈕 ``button_a`` 和 ``button_b`` 的類別。""" def is_pressed(self) -> bool: - """檢查按鈕是否按下。 + """檢查按鈕是否有按下。 :return: ``True`` if the specified button ``button`` is pressed, and ``False`` otherwise.""" ... def was_pressed(self) -> bool: - """檢查自裝置啟動或上次呼叫此方法以來是否按下該按鈕。 + """檢查自裝置啟動或上次呼叫此方法以來,是否有按下該按鈕。 Calling this method will clear the press state so that the button must be pressed again before this method will return @@ -105,9 +105,9 @@ that the button must be pressed again before this method will return :return: The number of presses since the device started or the last time this method was called""" ... button_a: Button -"""左鍵 ``Button`` 物件。""" +"""左側按鈕 ``Button`` 物件。""" button_b: Button -"""右鍵 ``Button`` 物件。""" +"""右側按鈕 ``Button`` 物件。""" class MicroBitDigitalPin: """數位引腳。 @@ -280,145 +280,145 @@ This API is intended only for use in Pulse-Width Modulation pin operations e.g. """ class Image: - """要在 micro:bit LED 顯示器上顯示的圖片。 + """要在 micro:bit LED 顯示器上顯示的圖像。 Given an image object it's possible to display it via the ``display`` API:: display.show(Image.HAPPY)""" HEART: Image - """愛心圖片。""" + """愛心圖像。""" HEART_SMALL: Image - """小愛心影像。""" + """小愛心圖像。""" HAPPY: Image - """開心的臉圖片。""" + """開心的臉圖像。""" SMILE: Image - """微笑的臉圖片。""" + """笑臉圖像。""" SAD: Image - """傷心的臉圖片。""" + """傷心的臉圖像。""" CONFUSED: Image - """困惑的臉圖片。""" + """困惑的臉圖像。""" ANGRY: Image - """生氣的臉圖片。""" + """生氣的臉圖像。""" ASLEEP: Image - """瞌睡的臉圖片。""" + """睡臉圖像。""" SURPRISED: Image - """驚訝的臉圖片。""" + """驚訝的臉圖像。""" SILLY: Image - """鬼臉圖片。""" + """鬼臉圖像。""" FABULOUS: Image - """戴太陽眼鏡的臉圖片。""" + """戴太陽眼鏡的臉圖像。""" MEH: Image - """冷漠的臉圖片。""" + """冷漠的臉圖像。""" YES: Image - """勾號圖片。""" + """勾號圖像。""" NO: Image - """叉號圖片。""" + """叉號圖像。""" CLOCK12: Image - """指針指向 12 點鐘的圖片。""" + """指針指向 12 點鐘的圖像。""" CLOCK11: Image - """指針指向 11 點鐘的圖片。""" + """指針指向 11 點鐘的圖像。""" CLOCK10: Image - """指針指向 10 點鐘的圖片。""" + """指針指向 10 點鐘的圖像。""" CLOCK9: Image - """指針指向 9 點鐘的圖片。""" + """指針指向 9 點鐘的圖像。""" CLOCK8: Image - """指針指向 8 點鐘的圖片。""" + """指針指向 8 點鐘的圖像。""" CLOCK7: Image - """指針指向 7 點鐘的圖片。""" + """指針指向 7 點鐘的圖像。""" CLOCK6: Image - """指針指向 6 點鐘的圖片。""" + """指針指向 6 點鐘的圖像。""" CLOCK5: Image - """指針指向 5 點鐘的圖片。""" + """指針指向 5 點鐘的圖像。""" CLOCK4: Image - """指針指向 4 點鐘的圖片。""" + """指針指向 4 點鐘的圖像。""" CLOCK3: Image - """指針指向 3 點鐘的圖片。""" + """指針指向 3 點鐘的圖像。""" CLOCK2: Image - """指針指向 2 點鐘的圖片。""" + """指針指向 2 點鐘的圖像。""" CLOCK1: Image - """指針指向 1 點鐘的圖片。""" + """指針指向 1 點鐘的圖像。""" ARROW_N: Image - """指向北方箭頭的圖片。""" + """指向北方箭頭的圖像。""" ARROW_NE: Image - """指向東北箭頭的圖片。""" + """指向東北箭頭的圖像。""" ARROW_E: Image - """指向東方箭頭的圖片。""" + """指向東方箭頭的圖像。""" ARROW_SE: Image - """指向東南箭頭的圖片。""" + """指向東南箭頭的圖像。""" ARROW_S: Image - """指向南方箭頭的圖片。""" + """指向南方箭頭的圖像。""" ARROW_SW: Image - """指向西南箭頭的圖片。""" + """指向西南箭頭的圖像。""" ARROW_W: Image - """指向西方箭頭的圖片。""" + """指向西方箭頭的圖像。""" ARROW_NW: Image - """指向西北箭頭的圖片。""" + """指向西北箭頭的圖像。""" TRIANGLE: Image - """朝上三角形的圖片。""" + """朝上三角形的圖像。""" TRIANGLE_LEFT: Image - """左角三角形的圖片。""" + """左角三角形的圖像。""" CHESSBOARD: Image """以棋盤圖案交錯發亮的 LED 燈。""" DIAMOND: Image - """鑽石圖片。""" + """鑽石圖像。""" DIAMOND_SMALL: Image - """小鑽石圖片。""" + """小鑽石圖像。""" SQUARE: Image - """正方形圖片。""" + """正方形圖像。""" SQUARE_SMALL: Image - """小正方形圖片。""" + """小正方形圖像。""" RABBIT: Image - """兔子圖片。""" + """兔子圖像。""" COW: Image - """乳牛圖片。""" + """乳牛圖像。""" MUSIC_CROTCHET: Image - """四分音符圖片。""" + """四分音符圖像。""" MUSIC_QUAVER: Image - """八分音符圖片。""" + """八分音符圖像。""" MUSIC_QUAVERS: Image - """一組八分音符圖片。""" + """一組八分音符圖像。""" PITCHFORK: Image - """乾草叉圖片。""" + """乾草叉圖像。""" XMAS: Image - """聖誕樹圖片。""" + """聖誕樹圖像。""" PACMAN: Image - """吃豆人街機角色圖片。""" + """小精靈街機角色圖像。""" TARGET: Image - """靶子圖片。""" + """靶子圖像。""" TSHIRT: Image - """T 恤圖片。""" + """T 恤圖像。""" ROLLERSKATE: Image - """輪式溜冰鞋圖片。""" + """輪式溜冰鞋圖像。""" DUCK: Image - """鴨子圖片。""" + """鴨子圖像。""" HOUSE: Image - """房子圖片。""" + """房子圖像。""" TORTOISE: Image - """陸龜圖片。""" + """陸龜圖像。""" BUTTERFLY: Image - """蝴蝶圖片。""" + """蝴蝶圖像。""" STICKFIGURE: Image - """簡筆人物畫圖片。""" + """簡筆畫圖像。""" GHOST: Image - """幽靈圖片。""" + """幽靈圖像。""" SWORD: Image - """劍圖片。""" + """劍圖像。""" GIRAFFE: Image - """長頸鹿圖片。""" + """長頸鹿圖像。""" SKULL: Image - """骷髏頭圖片。""" + """骷髏頭圖像""" UMBRELLA: Image - """雨傘圖片。""" + """雨傘圖像。""" SNAKE: Image - """蛇圖片。""" + """蛇圖像。""" ALL_CLOCKS: List[Image] - """按順序包含所有時鐘圖片的清單。""" + """按順序包含所有 CLOCK_圖像的列表。""" ALL_ARROWS: List[Image] - """按順序包含所有箭頭圖片的清單。""" + """按順序包含所有 ARROW_圖像的列表。""" @overload def __init__(self, string: str) -> None: - """從描述點亮哪些 LED 的字串建立圖片。 + """從描述點亮哪些 LED 的字串建立圖像。 ``string`` has to consist of digits 0-9 arranged into lines, describing the image, for example:: @@ -432,16 +432,16 @@ describing the image, for example:: will create a 5×5 image of an X. The end of a line is indicated by a colon. It's also possible to use newlines (\\n) insead of the colons. -:param string: 描述圖片的字串。""" +:param string: 描述圖像的字串。""" ... @overload def __init__(self, width: int=5, height: int=5, buffer: ReadableBuffer=None) -> None: - """建立一個 ``width`` 行 ``height`` 列的空白圖片。 + """建立一個 ``width`` 行 ``height`` 列的空白圖像。 -:param width: 可選的圖片寬度 -:param height: 可選的圖片高度 -:param buffer: 用可選陣列或在 0-9 範圍內的 ``width``×``height`` 整數位元組,來初始化圖片 +:param width: 可選的圖像寬度 +:param height: 可選的圖像高度 +:param buffer: 用可選陣列或在 0-9 範圍內的 ``width``×``height`` 整數位元組,來初始化圖像 Examples:: @@ -487,7 +487,7 @@ Example: ``my_image.get_pixel(0, 0)`` ... def shift_left(self, n: int) -> Image: - """透過向左移動圖片,以建立一個新影像。 + """透過向左移動圖像,以建立一個新圖像。 Example: ``Image.HEART_SMALL.shift_left(1)`` @@ -496,7 +496,7 @@ Example: ``Image.HEART_SMALL.shift_left(1)`` ... def shift_right(self, n: int) -> Image: - """透過向右移動圖片,以建立一個新影像。 + """透過向右移動圖像,以建立一個新圖像。 Example: ``Image.HEART_SMALL.shift_right(1)`` @@ -505,7 +505,7 @@ Example: ``Image.HEART_SMALL.shift_right(1)`` ... def shift_up(self, n: int) -> Image: - """透過向上移動圖片,以建立一個新影像。 + """透過向上移動圖像,以建立一個新圖像。 Example: ``Image.HEART_SMALL.shift_up(1)`` @@ -514,7 +514,7 @@ Example: ``Image.HEART_SMALL.shift_up(1)`` ... def shift_down(self, n: int) -> Image: - """透過向下移動圖片,以建立一個新影像。 + """透過向下移動圖像,以建立一個新圖像。 Example: ``Image.HEART_SMALL.shift_down(1)`` @@ -523,7 +523,7 @@ Example: ``Image.HEART_SMALL.shift_down(1)`` ... def crop(self, x: int, y: int, w: int, h: int) -> Image: - """透過裁剪圖片,以建立一個新影像。 + """透過裁剪圖像,以建立一個新圖像。 Example: ``Image.HEART.crop(1, 1, 3, 3)`` @@ -535,7 +535,7 @@ Example: ``Image.HEART.crop(1, 1, 3, 3)`` ... def copy(self) -> Image: - """建立影像的精確副本。 + """建立圖像的精確副本。 Example: ``Image.HEART.copy()`` @@ -543,7 +543,7 @@ Example: ``Image.HEART.copy()`` ... def invert(self) -> Image: - """透過反轉來源影像的像素亮度,以建立一個新影像。 + """透過反轉來源圖像的像素亮度,以建立一個新圖像。 Example: ``Image.SMALL_HEART.invert()`` @@ -551,7 +551,7 @@ Example: ``Image.SMALL_HEART.invert()`` ... def fill(self, value: int) -> None: - """設定影像中所有像素的亮度。 + """設定圖像中所有像素的亮度。 Example: ``my_image.fill(5)`` @@ -562,17 +562,17 @@ read-only images, like ``Image.HEART``.""" ... def blit(self, src: Image, x: int, y: int, w: int, h: int, xdest: int=0, ydest: int=0) -> None: - """將另一個影像中的一個區域複製到該影像中。 + """將另一個圖像中的一個區域複製到該圖像中。 Example: ``my_image.blit(Image.HEART, 1, 1, 3, 3, 1, 1)`` -:param src: 來源影像 -:param x: 來源影像中的起始資料行偏移量 -:param y: 來源影像中的起始資料列偏移量 -:param w: 要複製的資料行 -:param h: 要複製的資料列 -:param xdest: 此影像中要修改的資料列偏移量 -:param ydest: 此影像中要修改的資料列偏移量 +:param src: 來源圖像 +:param x: 來源圖像中的起始行位移 +:param y: 來源圖像中的起始列位移 +:param w: 要複製的行數 +:param h: 要複製的列數 +:param xdest: 此圖像中要修改的行位移 +:param ydest: 此圖像中要修改的列位移 Pixels outside the source image are treated as having a brightness of 0. @@ -588,31 +588,31 @@ For example, img.crop(x, y, w, h) can be implemented as:: ... def __repr__(self) -> str: - """取得影像的緊湊字串顯示。""" + """取得圖像的緊湊字串顯示。""" ... def __str__(self) -> str: - """取得影像的可讀字串顯示。""" + """取得圖像的可讀字串顯示。""" ... def __add__(self, other: Image) -> Image: - """透過將兩個影像的像素亮度值相加,以建立一個新影像。 + """透過將兩個圖像的像素亮度值相加,以建立一個新圖像。 Example: ``Image.HEART + Image.HAPPY`` -:param other: 要新增的影像。""" +:param other: 要新增的圖像。""" ... def __sub__(self, other: Image) -> Image: - """透過從該影像中減去另一個影像的亮度值,以建立一個新影像。 + """透過從該圖像中減去另一個圖像的亮度值,以建立一個新圖像。 Example: ``Image.HEART - Image.HEART_SMALL`` -:param other: 要減去的影像。""" +:param other: 要減去的圖像。""" ... def __mul__(self, n: float) -> Image: - """透過將各像素的亮度乘以 ``n``,以建立一個新影像。 + """透過將各像素的亮度乘以 ``n``,以建立一個新圖像。 Example: ``Image.HEART * 0.5`` @@ -620,7 +620,7 @@ Example: ``Image.HEART * 0.5`` ... def __truediv__(self, n: float) -> Image: - """透過將各像素的亮度除以 ``n``,以建立一個新影像。 + """透過將各像素的亮度除以 ``n``,以建立一個新圖像。 Example: ``Image.HEART / 2`` @@ -631,7 +631,7 @@ class SoundEvent: LOUD: SoundEvent """表示聲音事件的轉換,從 ``quiet`` 到 ``loud``,如鼓掌或喊叫。""" QUIET: SoundEvent - """表示聲音事件的轉換,從 ``loud`` 到 ``quiet``,例如說話或背景音樂。""" + """表示聲音事件的轉換,從 ``loud`` 到 ``quiet``。例如,說話或背景音樂。""" class Sound: """可以使用 ``audio.play(Sound.NAME)`` 調用內建聲音。""" diff --git a/lang/zh-tw/typeshed/stdlib/microbit/accelerometer.pyi b/lang/zh-tw/typeshed/stdlib/microbit/accelerometer.pyi index 67ae3b8..552c6bb 100644 --- a/lang/zh-tw/typeshed/stdlib/microbit/accelerometer.pyi +++ b/lang/zh-tw/typeshed/stdlib/microbit/accelerometer.pyi @@ -56,12 +56,12 @@ MicroPython understands the following gesture names: ``"up"``, ``"down"``, ``"3g"``, ``"6g"``, ``"8g"``, ``"shake"``. Gestures are always represented as strings. -:param name: 手勢名稱 +:param name: 手勢名稱。 :return: ``True`` if the gesture is active, ``False`` otherwise.""" ... def was_gesture(name: str) -> bool: - """檢查命名手勢自上次通話後是否處於活動狀態。 + """檢查命名手勢自上次呼叫後是否處於活動狀態。 Example: ``accelerometer.was_gesture('shake')`` @@ -70,7 +70,7 @@ MicroPython understands the following gesture names: ``"up"``, ``"down"``, ``"3g"``, ``"6g"``, ``"8g"``, ``"shake"``. Gestures are always represented as strings. -:param name: 手勢名稱 +:param name: 手勢名稱。 :return: ``True`` if the gesture was active since the last call, ``False`` otherwise.""" def get_gestures() -> Tuple[str, ...]: diff --git a/lang/zh-tw/typeshed/stdlib/microbit/audio.pyi b/lang/zh-tw/typeshed/stdlib/microbit/audio.pyi index 097812b..e3492af 100644 --- a/lang/zh-tw/typeshed/stdlib/microbit/audio.pyi +++ b/lang/zh-tw/typeshed/stdlib/microbit/audio.pyi @@ -3,7 +3,7 @@ from ..microbit import MicroBitDigitalPin, Sound, pin0 from typing import Iterable, Union def play(source: Union[Iterable[AudioFrame], Sound], wait: bool=True, pin: MicroBitDigitalPin=pin0, return_pin: Union[MicroBitDigitalPin, None]=None) -> None: - """播放內建聲音或自訂音訊幀。 + """播放內建聲音或自訂音訊框架。 Example: ``audio.play(Sound.GIGGLE)`` diff --git a/lang/zh-tw/typeshed/stdlib/microbit/compass.pyi b/lang/zh-tw/typeshed/stdlib/microbit/compass.pyi index 6e928c1..17c1708 100644 --- a/lang/zh-tw/typeshed/stdlib/microbit/compass.pyi +++ b/lang/zh-tw/typeshed/stdlib/microbit/compass.pyi @@ -18,7 +18,7 @@ Example: ``compass.is_calibrated()`` ... def clear_calibration() -> None: - """撤消校準,使指南針再次未校準。 + """復原校準,使指南針再次未校準。 Example: ``compass.clear_calibration()``""" ... @@ -62,7 +62,7 @@ Example: ``compass.heading()`` ... def get_field_strength() -> int: - """獲取裝置周圍磁場的大小。 + """取得裝置周圍磁場的強度。 Example: ``compass.get_field_strength()`` diff --git a/lang/zh-tw/typeshed/stdlib/microbit/display.pyi b/lang/zh-tw/typeshed/stdlib/microbit/display.pyi index c6edb67..5b2a57e 100644 --- a/lang/zh-tw/typeshed/stdlib/microbit/display.pyi +++ b/lang/zh-tw/typeshed/stdlib/microbit/display.pyi @@ -1,24 +1,24 @@ -"""在 5×5 LED 顯示器上顯示文字、影像和動畫。""" +"""在 5×5 LED 顯示器上顯示文字、圖像和動畫。""" from ..microbit import Image from typing import Union, overload, Iterable def get_pixel(x: int, y: int) -> int: - """取得 ``x`` 列和 ``y`` 行的 LED 亮度。 + """取得行 ``x`` 和列 ``y`` 的 LED 亮度。 Example: ``display.get_pixel(0, 0)`` -:param x: 顯示資料行 (0..4) -:param y: 顯示資料列 (0..4) +:param x: 顯示行 (0..4) +:param y: 顯示列 (0..4) :return: A number between 0 (off) and 9 (bright)""" ... def set_pixel(x: int, y: int, value: int) -> None: - """在 ``x`` 資料行和 ``y`` 資料列設定 LED 的亮度。 + """在行 ``x`` 和列 ``y`` 設定 LED 亮度。 Example: ``display.set_pixel(0, 0, 9)`` -:param x: 顯示資料行 (0..4) -:param y: 顯示資料列 (0..4) +:param x: 顯示行 (0..4) +:param y: 顯示列 (0..4) :param value: 0 (關閉) 和 9 (最亮) 之間的亮度""" ... @@ -29,18 +29,18 @@ Example: ``display.clear()``""" ... def show(image: Union[str, float, int, Image, Iterable[Image]], delay: int=400, wait: bool=True, loop: bool=False, clear: bool=False) -> None: - """在 LED 顯示器上顯示影像、字母或數字。 + """在 LED 顯示器上顯示圖像、字母或數字。 Example: ``display.show(Image.HEART)`` When ``image`` is an image or a list of images then each image is displayed in turn. If ``image`` is a string or number, each letter or digit is displayed in turn. -:param image: 要顯示的字串、數字、影像或影像列表。 -:param delay: 每個字母、數字或影像之間的顯示時間為 ``delay`` 毫秒。 +:param image: 要顯示的字串、數字、圖像或圖像列表。 +:param delay: 每個字母、數字或圖像之間的顯示時間為 ``delay`` 毫秒。 :param wait: 如果 ``wait`` 為 ``True``,此函式將封鎖直到動畫完成,否則動畫將在背景發生。 :param loop: 如果 ``loop`` 為 ``True``,動畫將永遠重複。 -:param clear: 如果 ``clear`` 為 ``True``,則顯示將在序列完成後清除。 +:param clear: 如果 ``clear`` 為 ``True``,則顯示將在序列完成後被清除。 The ``wait``, ``loop`` and ``clear`` arguments must be specified using their keyword.""" ... @@ -50,18 +50,18 @@ def scroll(text: Union[str, float, int], delay: int=150, wait: bool=True, loop: Example: ``display.scroll('micro:bit')`` -:param text: 要捲動的字串。如果 ``text`` 是整數或浮點數,則首先使用 ``str()`` 將其轉換為字串。 -:param delay: ``delay`` 參數能控制文字捲動的速度。 +:param text: 要捲動的字串。如果 ``text`` 是整數或浮點數,則先使用 ``str()`` 將其轉換為字串。 +:param delay: ``delay`` 參數可控制文字捲動的速度。 :param wait: 如果 ``wait`` 為 ``True``,此函式將封鎖直到動畫完成,否則動畫將在背景發生。 :param loop: 如果 ``loop`` 為 ``True``,動畫將永遠重複。 -:param monospace: 如果 ``monospace`` 為 ``True``,則字元的寬度將全部佔用 5 個像素資料行,否則捲動時每個字元之間將恰好有 1 個空白像素資料行。 +:param monospace: 如果 ``monospace`` 為 ``True``,字元寬度將全部佔用 5 個像素行。否則,捲動時每個字元之間將恰好有 1 個空白像素行。 The ``wait``, ``loop`` and ``monospace`` arguments must be specified using their keyword.""" ... def on() -> None: - """打開 LED 顯示器。 + """開啟 LED 顯示器。 Example: ``display.on()``""" ... @@ -73,7 +73,7 @@ Example: ``display.off()``""" ... def is_on() -> bool: - """檢查 LED 顯示器是否啟用。 + """檢查 LED 顯示器是否有啟用。 Example: ``display.is_on()`` @@ -81,7 +81,7 @@ Example: ``display.is_on()`` ... def read_light_level() -> int: - """讀取光照水平。 + """讀取光度。 Example: ``display.read_light_level()`` diff --git a/lang/zh-tw/typeshed/stdlib/microbit/i2c.pyi b/lang/zh-tw/typeshed/stdlib/microbit/i2c.pyi index 0332621..dedb1d7 100644 --- a/lang/zh-tw/typeshed/stdlib/microbit/i2c.pyi +++ b/lang/zh-tw/typeshed/stdlib/microbit/i2c.pyi @@ -1,4 +1,4 @@ -"""使用 I²C 匯流排協定與裝置通訊。""" +"""使用 I²C 匯流排通訊協定與裝置通訊。""" from _typeshed import ReadableBuffer from ..microbit import MicroBitDigitalPin, pin19, pin20 from typing import List diff --git a/lang/zh-tw/typeshed/stdlib/microbit/microphone.pyi b/lang/zh-tw/typeshed/stdlib/microbit/microphone.pyi index 653783b..894fa45 100644 --- a/lang/zh-tw/typeshed/stdlib/microbit/microphone.pyi +++ b/lang/zh-tw/typeshed/stdlib/microbit/microphone.pyi @@ -3,7 +3,7 @@ from typing import Optional, Tuple from ..microbit import SoundEvent def current_event() -> Optional[SoundEvent]: - """獲取最後錄製的聲音事件 + """取得最後錄製的聲音事件 Example: ``microphone.current_event()`` @@ -11,7 +11,7 @@ Example: ``microphone.current_event()`` ... def was_event(event: SoundEvent) -> bool: - """檢查自上次通話後是否至少聽到一次聲音。 + """檢查自上次呼叫後,是否至少有聽到一次聲音。 Example: ``microphone.was_event(SoundEvent.LOUD)`` @@ -22,7 +22,7 @@ This call clears the sound history before returning. ... def is_event(event: SoundEvent) -> bool: - """檢查檢測到的最新聲音事件。 + """檢查偵測到的最新聲音事件。 Example: ``microphone.is_event(SoundEvent.LOUD)`` @@ -33,7 +33,7 @@ This call does not clear the sound event history. ... def get_events() -> Tuple[SoundEvent, ...]: - """以元組的形式獲取聲音事件歷史。 + """以元組的形式取得聲音事件歷史。 Example: ``microphone.get_events()`` @@ -50,11 +50,11 @@ Example: ``microphone.set_threshold(SoundEvent.LOUD, 250)`` A high threshold means the event will only trigger if the sound is very loud (>= 250 in the example). :param event: 聲音事件,例如 ``SoundEvent.LOUD`` 或 ``SoundEvent.QUIET``。 -:param value: 0-255 範圍內的閾值級別。""" +:param value: 0-255 範圍內的閾值等級。""" ... def sound_level() -> int: - """獲取聲壓等級。 + """取得聲壓位準。 Example: ``microphone.sound_level()`` diff --git a/lang/zh-tw/typeshed/stdlib/microbit/speaker.pyi b/lang/zh-tw/typeshed/stdlib/microbit/speaker.pyi index 69b4294..879118f 100644 --- a/lang/zh-tw/typeshed/stdlib/microbit/speaker.pyi +++ b/lang/zh-tw/typeshed/stdlib/microbit/speaker.pyi @@ -9,7 +9,7 @@ This does not disable sound output to an edge connector pin.""" ... def on() -> None: - """打開揚聲器。 + """開啟揚聲器。 Example: ``speaker.on()``""" ... \ No newline at end of file diff --git a/lang/zh-tw/typeshed/stdlib/microbit/uart.pyi b/lang/zh-tw/typeshed/stdlib/microbit/uart.pyi index e258eb2..c7e84da 100644 --- a/lang/zh-tw/typeshed/stdlib/microbit/uart.pyi +++ b/lang/zh-tw/typeshed/stdlib/microbit/uart.pyi @@ -3,9 +3,9 @@ from _typeshed import WriteableBuffer from ..microbit import MicroBitDigitalPin from typing import Optional, Union ODD: int -"""奇數檢查""" +"""奇數同位檢查""" EVEN: int -"""偶數檢查""" +"""偶數同位檢查""" def init(baudrate: int=9600, bits: int=8, parity: Optional[int]=None, stop: int=1, tx: Optional[MicroBitDigitalPin]=None, rx: Optional[MicroBitDigitalPin]=None) -> None: """初始化序列通訊。 @@ -14,9 +14,9 @@ Example: ``uart.init(115200, tx=pin0, rx=pin1)`` :param baudrate: 通訊速度。 :param bits: 正在傳輸的位元組大小,micro:bit 只支援 8。 -:param parity: 如何檢查奇數,``None``、``uart.ODD`` 或 ``uart.EVEN``。 +:param parity: 如何檢查奇偶性,``None``、``uart.ODD`` 或 ``uart.EVEN``。 :param stop: 停止位元的數量,micro:bit 必須為 1。 -:param tx: 發射引腳。 +:param tx: 傳輸引腳。 :param rx: 正在接收引腳。 Initializing the UART on external pins will cause the Python console on @@ -56,7 +56,7 @@ Example: ``uart.readinto(input_buffer)`` ... def readline() -> Optional[bytes]: - """讀取一行,以換行符結尾。 + """讀取一行,以新行字元結尾。 Example: ``uart.readline()`` diff --git a/lang/zh-tw/typeshed/stdlib/micropython.pyi b/lang/zh-tw/typeshed/stdlib/micropython.pyi index 314fdc0..3b2ad82 100644 --- a/lang/zh-tw/typeshed/stdlib/micropython.pyi +++ b/lang/zh-tw/typeshed/stdlib/micropython.pyi @@ -43,7 +43,7 @@ The optimisation level controls the following compilation features: @overload def opt_level(level: int) -> None: - """設定指令碼後續編譯的最佳化級別。 + """設定指令碼後續編譯的最佳化等級。 Example: ``micropython.opt_level(1)`` @@ -62,7 +62,7 @@ The optimisation level controls the following compilation features: The default optimisation level is usually level 0. -:param level: 整數最佳化級別。""" +:param level: 整數最佳化等級。""" ... def mem_info(verbose: Any=None) -> None: diff --git a/lang/zh-tw/typeshed/stdlib/music.pyi b/lang/zh-tw/typeshed/stdlib/music.pyi index 97280ec..1037432 100644 --- a/lang/zh-tw/typeshed/stdlib/music.pyi +++ b/lang/zh-tw/typeshed/stdlib/music.pyi @@ -19,9 +19,9 @@ RINGTONE: Tuple[str, ...] To be used to indicate an incoming message. """ FUNK: Tuple[str, ...] -"""旋律:為秘密特工和犯罪策劃者準備的放克低音。""" +"""旋律:為特務和犯罪首腦準備的放克貝斯。""" BLUES: Tuple[str, ...] -"""旋律:布基烏基 12 小節藍調走路低音。""" +"""旋律:布基烏基 12 小節藍調走路貝斯。""" BIRTHDAY: Tuple[str, ...] """旋律:「祝你生日快樂…」 @@ -36,11 +36,11 @@ PUNCHLINE: Tuple[str, ...] PYTHON: Tuple[str, ...] """旋律:約翰菲利普蘇薩的進行曲《自由鐘》,又名《蒙提派森的飛行馬戲團》的主題曲 (Python 程式語言以此命名)。""" BADDY: Tuple[str, ...] -"""旋律:無聲電影時代的壞人登場。""" +"""旋律:無聲電影時代的惡人登場。""" CHASE: Tuple[str, ...] """旋律:無聲電影時代的追逐場景。""" BA_DING: Tuple[str, ...] -"""旋律:表示某事發生的簡短訊號。""" +"""旋律:表示某事發生的短訊號。""" WAWAWAWAA: Tuple[str, ...] """旋律:非常悲傷的長號。""" JUMP_UP: Tuple[str, ...] @@ -53,11 +53,11 @@ POWER_DOWN: Tuple[str, ...] """旋律:表示失去成就的悲傷號角聲。""" def set_tempo(ticks: int=4, bpm: int=120) -> None: - """設定播放的大致速度。 + """設定播放的大致節奏。 Example: ``music.set_tempo(bpm=120)`` -:param ticks: 構成節拍的 tick 數。 +:param ticks: 構成節拍的滴答聲數。 :param bpm: 一個整數,決定每分鐘有多少次節拍。 Suggested default values allow the following useful behaviour: @@ -72,7 +72,7 @@ To work out the length of a tick in milliseconds is very simple arithmetic: ... def get_tempo() -> Tuple[int, int]: - """以整數元組的形式獲取當前速度:``(ticks, bpm)``。 + """以整數元組的形式取得當前節奏:``(ticks, bpm)``。 Example: ``ticks, beats = music.get_tempo()`` @@ -87,7 +87,7 @@ Example: ``music.play(music.NYAN)`` :param music: 特殊音符中指定的音樂 `_ :param pin: (引腳) 用於外接揚聲器的輸出引腳 (預設為 ``pin0``),``None`` 表示無聲音。 :param wait: 如果 ``wait`` 設定為 ``True``,則此函式會封鎖。 -:param loop: 如果 ``loop`` 設定為 ``True``,曲調會重複直到呼叫 ``stop`` 或封鎖呼叫被中斷。 +:param loop: 如果 ``loop`` 設定為 ``True``,樂曲會重複直到呼叫 ``stop`` 或封鎖呼叫被中斷。 Many built-in melodies are defined in this module.""" ... @@ -116,7 +116,7 @@ Example: ``music.stop()`` :param pin: (引腳) 可以提供一個可選引數來指定一個引腳,例如 ``music.stop(pin1)``。""" def reset() -> None: - """將 tick、bpm、duration 和 octave 重設為其預設值。 + """將 ticks、bpm、duration 和 octave 重設為其預設值。 Example: ``music.reset()`` diff --git a/lang/zh-tw/typeshed/stdlib/os.pyi b/lang/zh-tw/typeshed/stdlib/os.pyi index 573b279..cf8c724 100644 --- a/lang/zh-tw/typeshed/stdlib/os.pyi +++ b/lang/zh-tw/typeshed/stdlib/os.pyi @@ -16,7 +16,7 @@ def remove(filename: str) -> None: Example: ``os.remove('data.txt')`` -:param filename: 要刪除的文件。 +:param filename: 要刪除的檔案。 If the file does not exist an ``OSError`` exception will occur.""" ... diff --git a/lang/zh-tw/typeshed/stdlib/radio.pyi b/lang/zh-tw/typeshed/stdlib/radio.pyi index e786000..2f7aa12 100644 --- a/lang/zh-tw/typeshed/stdlib/radio.pyi +++ b/lang/zh-tw/typeshed/stdlib/radio.pyi @@ -2,9 +2,9 @@ from _typeshed import WriteableBuffer from typing import Optional, Tuple RATE_1MBIT: int -"""常數用於指示每秒 1 MBit 的傳輸量。""" +"""常數用於指示每秒 1 MBit 的輸送量。""" RATE_2MBIT: int -"""常數用於指示每秒 2 MBit 的傳輸量。""" +"""常數用於指示每秒 2 MBit 的輸送量。""" def on() -> None: """開啟無線電。 @@ -16,7 +16,7 @@ up memory that you may otherwise need.""" ... def off() -> None: - """關閉收音機,節省電量和記憶體。 + """關閉無線電,節省電量和記憶體。 Example: ``radio.off()``""" ... @@ -36,11 +36,11 @@ The default configuration is suitable for most use. 訊息將透過此頻道傳送。只有透過此頻道接收的訊息,才會放入傳入訊息佇列。每一步都是 1MHz 寬,以 2400MHz 為基礎。 :param power: (default=6) 是一個從 0 到 7 (包含) 的整數值,表示無線電訊息時使用的訊號功率。 數值越高,訊號越強,但裝置消耗的功率越多。編號轉換為下列 dBm (分貝毫瓦) 數值列表中的位置:-30、-20、-16、-12、-8、-4、0、4。 -:param address: (default=0x75626974) 任意名稱,表示為 32 位元地址,用於在硬體級別篩選傳入的資料套件,僅保留與您設定的地址相符的那些。 +:param address: (default=0x75626974) 任意名稱,表示為 32 位元位址,用於在硬體等級篩選傳入的資料套件,僅保留與您設定的位址相符的那些。 其他 micro:bit 相關平台使用的預設設定,則是此處使用的預設設定。 :param group: (default=0) 篩選訊息時與 ``address`` 一起使用的 8 位元值 (0-255)。 從概念上講,"address" 就像一個家庭/辦公室地址,而 "group" 就像您要向該地址傳送訊息的人。 -:param data_rate: (default=``radio.RATE_1MBIT``) 表示資料傳輸量發生的速度。 +:param data_rate: (default=``radio.RATE_1MBIT``) 表示資料輸送量發生的速度。 可以是 ``radio`` 模組中定義的下列常數之一:``RATE_250KBIT``、``RATE_1MBIT`` 或 ``RATE_2MBIT``。 If ``config`` is not called then the defaults described above are assumed.""" @@ -71,11 +71,11 @@ Example: ``radio.receive_bytes()`` ... def receive_bytes_into(buffer: WriteableBuffer) -> Optional[int]: - """將訊息佇列中的下一則傳入訊息複製到緩衝區中。 + """將訊息佇列中的下一則傳入訊息複製到緩衝區。 Example: ``radio.receive_bytes_info(buffer)`` -:param buffer: 將訊息佇列中的下一則傳入訊息複製到緩衝區中。 +:param buffer: 目標緩衝區。如果訊息大小大於緩衝區,則訊息會被截斷。 :return: ``None`` if there are no pending messages, otherwise it returns the length of the message (which might be more than the length of the buffer).""" ... diff --git a/lang/zh-tw/typeshed/stdlib/random.pyi b/lang/zh-tw/typeshed/stdlib/random.pyi index c359bcd..e606e08 100644 --- a/lang/zh-tw/typeshed/stdlib/random.pyi +++ b/lang/zh-tw/typeshed/stdlib/random.pyi @@ -57,7 +57,7 @@ def choice(seq: Sequence[_T]) -> _T: Example: ``random.choice([Image.HAPPY, Image.SAD])`` -:param seq: 序列 +:param seq: 序列。 If ``seq`` is empty, raises ``IndexError``.""" ... diff --git a/lang/zh-tw/typeshed/stdlib/speech.pyi b/lang/zh-tw/typeshed/stdlib/speech.pyi index af418e5..80d07fa 100644 --- a/lang/zh-tw/typeshed/stdlib/speech.pyi +++ b/lang/zh-tw/typeshed/stdlib/speech.pyi @@ -19,15 +19,15 @@ See `the online documentation None: - """發音音素。 + """發出音素的聲音。 Example: ``speech.pronounce(' /HEHLOW WERLD')`` :param phonemes: 發音的音素字串 -:param pitch: (間距) 代表聲音音高的數字 -:param speed: 代表聲音速度的數字 -:param mouth: 一個代表聲音的嘴巴的數字 -:param throat: 代表聲音的喉嚨的數字 +:param pitch: (間距) 一個代表聲音音高的數字 +:param speed: 一個代表聲音速度的數字 +:param mouth: 一個代表聲音口型的數字 +:param throat: 一個代表聲音喉型的數字 :param pin: (引腳) 指定輸出引腳的可選引數,可用於覆寫預設值 ``pin0``。 如果我們不想從引腳上播放任何聲音,可以使用 ``pin=None``。僅限 micro:bit。 @@ -43,10 +43,10 @@ def say(words: str, pitch: int=64, speed: int=72, mouth: int=128, throat: int=12 Example: ``speech.say('hello world')`` :param words: 要說的一串詞。 -:param pitch: (間距) 代表聲音音高的數字 -:param speed: 代表聲音速度的數字 -:param mouth: 一個代表聲音的嘴巴的數字 -:param throat: 代表聲音的喉嚨的數字 +:param pitch: (間距) 一個代表聲音音高的數字 +:param speed: 一個代表聲音速度的數字 +:param mouth: 一個代表聲音口型的數字 +:param throat: 一個代表聲音喉型的數字 :param pin: (引腳) 指定輸出引腳的可選引數可用於覆寫預設值 ``pin0``。 如果我們無意從引腳上播放任何聲音,可以使用 ``pin=None``。僅限 micro:bit。 @@ -65,10 +65,10 @@ def sing(phonemes: str, pitch: int=64, speed: int=72, mouth: int=128, throat: in Example: ``speech.sing(' /HEHLOW WERLD')`` :param phonemes: 要唱的一串詞。 -:param pitch: (間距) 代表聲音音高的數字 -:param speed: 代表聲音速度的數字 -:param mouth: 一個代表聲音的嘴巴的數字 -:param throat: 代表聲音的喉嚨的數字 +:param pitch: (間距) 一個代表聲音音高的數字 +:param speed: 一個代表聲音速度的數字 +:param mouth: 一個代表聲音口型的數字 +:param throat: 一個代表聲音喉型的數字 :param pin: (引腳) 指定輸出引腳的可選引數,可用於覆寫預設值 ``pin0``。 如果我們不想從引腳上播放任何聲音,可以使用 ``pin=None``。僅限 micro:bit。 diff --git a/lang/zh-tw/typeshed/stdlib/struct.pyi b/lang/zh-tw/typeshed/stdlib/struct.pyi index f386ac1..fbe57da 100644 --- a/lang/zh-tw/typeshed/stdlib/struct.pyi +++ b/lang/zh-tw/typeshed/stdlib/struct.pyi @@ -12,45 +12,45 @@ Example: ``struct.calcsize('hf')`` ... def pack(fmt: str, v1: Any, *vn: Any) -> bytes: - """根據格式字串打包數值。 + """根據格式字串,壓縮數值。 Example: ``struct.pack('hf', 1, 3.1415)`` -:param fmt: 格式字串 -:param v1: 首位數值 +:param fmt: 格式字串。 +:param v1: 首位數值。 :param *vn: 剩餘數值。 :return A bytes object encoding the values.""" ... def pack_into(fmt: str, buffer: WriteableBuffer, offset: int, v1: Any, *vn: Any) -> None: - """根據格式字串打包數值。 + """根據格式字串,壓縮數值。 Example: ``struct.pack_info('hf', buffer, 1, 3.1415)`` -:param fmt: 格式字串 +:param fmt: 格式字串。 :param buffer: 要寫入的緩衝區。 -:param offset: 緩衝區的偏移量。從緩衝區末尾開始計數可能為負數。 -:param v1: 首位數值 -:param *vn: 剩餘數值""" +:param offset: 緩衝區內的位移。從緩衝區結尾開始計數,該位移可能為負數。 +:param v1: 首位數值。 +:param *vn: 剩餘數值。""" ... def unpack(fmt: str, data: ReadableBuffer) -> Tuple[Any, ...]: - """根據格式字串解包數值。 + """根據格式字串,解壓縮數值。 Example: ``v1, v2 = struct.unpack('hf', buffer)`` -:param fmt: 格式字串 +:param fmt: 格式字串。 :param data: 資料。 :return: A tuple of the unpacked values.""" ... def unpack_from(fmt: str, buffer: ReadableBuffer, offset: int=0) -> Tuple: - """根據格式字串解包數值。 + """根據格式字串,從緩衝區解壓縮資料。 Example: ``v1, v2 = struct.unpack_from('hf', buffer)`` -:param fmt: 格式字串 +:param fmt: 格式字串。 :param buffer: 要讀取的來源緩衝區。 -:param offset: 緩衝區的偏移量。從緩衝區末尾開始計數可能為負數。 +:param offset: 緩衝區內的位移。從緩衝區結尾開始計數,該位移可能為負數。 :return: A tuple of the unpacked values.""" ... \ No newline at end of file diff --git a/lang/zh-tw/typeshed/stdlib/sys.pyi b/lang/zh-tw/typeshed/stdlib/sys.pyi index 099ec88..3342ae5 100644 --- a/lang/zh-tw/typeshed/stdlib/sys.pyi +++ b/lang/zh-tw/typeshed/stdlib/sys.pyi @@ -22,7 +22,7 @@ Example: ``sys.print_exception(e)`` This is simplified version of a function which appears in the ``traceback`` module in CPython.""" argv: List[str] -"""當前程式啟動時使用的可變引數列表。""" +"""目前程式啟動時,所使用的可變引數列表。""" byteorder: str """系統的位元組順序 (``"little"`` 或 ``"big"``)。""" @@ -67,13 +67,13 @@ value directly, but instead count number of bits in it:: # "> 32", "> 64" style of comparisons. """ modules: Dict[str, Any] -"""載入模組的字典。 +"""已載入模組的字典。 On some ports, it may not include builtin modules.""" path: List[str] """用於搜尋匯入模組的可變字典列表。""" platform: str -"""MicroPython 執行的平台。 +"""正在執行 MicroPython 的平台。 For OS/RTOS ports, this is usually an identifier of the OS, e.g. ``"linux"``. For baremetal ports it is an identifier of a board, e.g. ``"pyboard"`` for diff --git a/lang/zh-tw/typeshed/stdlib/time.pyi b/lang/zh-tw/typeshed/stdlib/time.pyi index 39a2ae1..2a7d325 100644 --- a/lang/zh-tw/typeshed/stdlib/time.pyi +++ b/lang/zh-tw/typeshed/stdlib/time.pyi @@ -7,7 +7,7 @@ def sleep(seconds: Union[int, float]) -> None: Example: ``time.sleep(1)`` :param seconds: 睡眠的秒數。 -使用浮點數代替分數來計算秒數。""" +使用浮點數代表睡眠秒數的小數。""" ... def sleep_ms(ms: int) -> None: @@ -27,7 +27,7 @@ Example: ``time.sleep_us(1000)`` ... def ticks_ms() -> int: - """取得具有任意參考點的遞增毫秒計數器,該計數器會在某個值之後繞回。 (tick ms) + """取得具有任意參考點的遞增毫秒計數器,該計數器會在某個值之後繞回。 Example: ``time.ticks_ms()`` @@ -35,7 +35,7 @@ Example: ``time.ticks_ms()`` ... def ticks_us() -> int: - """取得具有任意參考點的遞增微秒計數器,該計數器會在某個值之後繞回。 (tick us) + """取得具有任意參考點的遞增微秒計數器,該計數器會在某個值之後繞回。 Example: ``time.ticks_us()`` @@ -43,7 +43,7 @@ Example: ``time.ticks_us()`` ... def ticks_add(ticks: int, delta: int) -> int: - """特定數字的偏移 tick 值,可以是正數或負數。 + """特定數字的位移滴答聲值,可以是正數或負數。 Example: ``time.ticks_add(time.ticks_ms(), 200)`` @@ -51,8 +51,8 @@ Given a ticks value, this function allows to calculate ticks value delta ticks before or after it, following modular-arithmetic definition of tick values. -:param ticks: tick 值 -:param delta: 整數偏移量 +:param ticks: 滴答聲值 +:param delta: 整數位移 Example:: @@ -69,8 +69,8 @@ Example:: ... def ticks_diff(ticks1: int, ticks2: int) -> int: - """測量從 ``time.ticks_ms()`` 或 ``ticks_us()`` 返回值之間的 tick 差異,有符號值 -可能會繞回。 (tick diff) + """測量從 +``time.ticks_ms()`` 或 ``ticks_us()`` 傳回值之間的滴答聲差異。此參數是一個可能會繞回的帶符號值。 (tick diff) Example: ``time.ticks_diff(scheduled_time, now)``