Skip to content

Commit

Permalink
Include more vector swizzle permutations in typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
esoma committed Jan 13, 2024
1 parent 796e8fc commit 82845bc
Show file tree
Hide file tree
Showing 2 changed files with 209,238 additions and 37,560 deletions.
4 changes: 2 additions & 2 deletions codegen/templates/_emath.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class {{ type }}:

{% for attributes in ['xyzw', 'rgba', 'stqp', 'uv'] %}
{% for count in range(1, 5) %}
{% for prop in itertools.permutations(attributes[:component_count] + 'ol', count) %}
{% for prop in itertools.product(attributes[:component_count] + 'ol', repeat=count) %}
{% if set(prop) - set ('ol') and ''.join(prop) != 'or' %}
@property
def {{ ''.join(prop) }}(self) -> {% if count > 1 %}{{ type[:-1] }}{{ count }}{% else %}{{ component_type }}{% endif %}: ...
Expand All @@ -175,7 +175,7 @@ class {{ type }}:
{% endfor %}

{% for count in range(1, 5) %}
{% for prop in itertools.permutations('ol', count) %}
{% for prop in itertools.product('ol', repeat=count) %}
{% if len(prop) > 1 %}
@property
def {{ ''.join(prop) }}(self) -> {% if count > 1 %}{{ type[:-1] }}{{ count }}{% else %}{{ component_type }}{% endif %}: ...
Expand Down
Loading

0 comments on commit 82845bc

Please sign in to comment.