GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    Yuicho (yuicho@mstdn.yuicho.net)'s status on Tuesday, 17-Mar-2026 06:23:53 JSTYuichoYuicho
    in reply to
    • zunda

    @zundan 調べてみたら、どうやらpython3ではkeys()とかが返すものがlistではなくdict_keysオブジェクトで、これにsortメソッドがないことが原因らしいです…
    普段sortedしか使わなくて知らなかった…

    自分はこういうふうにしてます〜
    やってることはほとんど同じですが、dictをそのままkeysとして扱うのが抵抗あるので、あえてkeys()を挟むようにしてます〜

    ```diff
    sorted_keys = dict.keys()
    - sorted_keys.sort()
    + sorted_keys = sorted(sorted_keys)
    ```

    In conversationabout 3 months ago from mstdn.yuicho.netpermalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.