matrix-org / matrix-org/matrix-spec

Underscores in string powerlevels

Open
#2,314 1 comment 0 reactions 0 assignees View on GitHub
clarification
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

**Link to problem area**: https://spec.matrix.org/v1.18/rooms/v9/#mroompower_levels-events-accept-values-as-strings

**Issue**
*Spawned from [discussion](https://matrix.to/#/!i5D5LLct_DYG-4hQprLzrxdbZ580U9UB6AEgFnk6rZQ/$3hp7bIvnhcdAI5pJdvvXKjDIptcD4WVDvi7toPuX1es?via=element.io&via=matrix.org&via=beeper.com) in the Synapse Development room*

Synapse would appear to allow underscores in string powerlevels as its only validation is passing the string into `int` and rejecting on a `ValueError`, but it is not raised:
```
>>> int("10_000_000")
10000000
>>>
```

This behaviour appears to have been added in Python 3.6: https://peps.python.org/pep-0515/

Given the transformations in that spec section are attemtping to mirror the functionality of `int`, should the spec be updated to reflect this, or Synapse?

Contributor guide

Open the contributing guide

Research direction

Start with the linked Matrix specification section and compare its stated transformations with Python's int behavior, then review the linked Synapse Development discussion for the intended resolution. Done means deciding whether the specification or Synapse should change and documenting the resulting behavior in the relevant specification text.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.