Coder Social home page Coder Social logo

enforcetypes's Introduction

Welcome, Stranger

Mind telling me what the heck you're doing here? I'm not that interesting! I do have a blog for when I do something mildly interesting. I suppose you should enjoy the stat dump while you're here though. Oh and the short list of suggested info too, those seem fun!

  • ๐Ÿ”ญ I'm currently working on getting a Rust implementation of Named Shared Memory working, adding QoL to windows-rs, and mental preparation to update Zwei again;
  • ๐ŸŒฑ I'm currently learning more about Windows internals than I'd like to know;
  • ๐Ÿ‘ฏ I'm looking to collaborate on anything really; My extensions to windows-rs kinda died because I'm pretty darn busy. Would love to help on projects I like using though!
  • ๐Ÿค” I'm looking for help with windows-rs-ext mainly.
  • ๐Ÿ’ฌ Ask me about what I did last night! I swear it's not a bad joke, I make long days at work so night time is when I do fun stuff.
  • ๐Ÿ“ซ How to reach me: Discord @rivenskaye, email Riven [at] tae.moe, or by telex
  • ๐Ÿ˜„ I'd like to get some more time free to continue playing with the CCITT encoder/decoder I was planning with a friend. No, fax is not dead.
  • โšก Fun fact: monochrome TIFF images embedded in PDFs are still valid CCITT fax format imagery!

Metrics generated by lowlighter/metrics

enforcetypes's People

Contributors

rivenskaye avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

heapunderfl0w

enforcetypes's Issues

Generic and subscriptable annotations result in errors

Using a function with a Any type parameter does not work and crashes instead

MVE

from typing import Any
import EnforceTypes as ET

@ET.functypes
def mve(params: Any):
    pass # function content is irrelevant

mve("funny param")

this results in the following error:

Traceback (most recent call last):
  File "E:\files\source\Projects\_misc\ex\any_example_enforcetypes\mve.py", line 8, in <module>
    mve("funny param")
  File "C:\Users\HeapUnderflow\.virtualenvs\any_example_enforcetypes-0Csrbawq\lib\site-packages\EnforceTypes\Functions.py", line 42, in newcall
    if not isinstance(kw_val, argtype) and not isinstance(kw_val, argtuple):
  File "C:\Program Files\Python39\lib\typing.py", line 345, in __instancecheck__
    raise TypeError(f"{self} cannot be used with isinstance()")
TypeError: typing.Any cannot be used with isinstance()

interesting enough using a list->tuple->any chain exhibits slightly different behavior

from typing import Any, List, Tuple
import EnforceTypes as ET

@ET.functypes
def mve(params: List[Tuple[Any, Any]]):
    pass # function content is irrelevant

mve([("funny param a", 0x69420)])

this results in the following error:

Traceback (most recent call last):
  File "E:\files\source\Projects\_misc\ex\any_example_enforcetypes\mve.py", line 8, in <module>
    mve([("funny param a", 0x69420)])
  File "C:\Users\HeapUnderflow\.virtualenvs\any_example_enforcetypes-0Csrbawq\lib\site-packages\EnforceTypes\Functions.py", line 42, in newcall
    if not isinstance(kw_val, argtype) and not isinstance(kw_val, argtuple):
  File "C:\Program Files\Python39\lib\typing.py", line 715, in __instancecheck__
    return self.__subclasscheck__(type(obj))
  File "C:\Program Files\Python39\lib\typing.py", line 718, in __subclasscheck__
    raise TypeError("Subscripted generics cannot be used with"
TypeError: Subscripted generics cannot be used with class and instance checks

System Information

OS: Windows 10, x64
Python: 3.9.7 & 3.9.13

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.