I like programming and anime.

I manage the bot /u/mahoro@lemmy.ml

  • 14 Posts
  • 77 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle




  • Just because you can get part of your education remotely or through self-learning didn’t mean “anything can be learned online”.

    And if you were hiring a math tutor for your kid, would you prefer a self-proclaimed expert from watching YouTube videos or would you want someone who got a degree from a credentialed university? And even if you don’t care, why are you surprised that others would be skeptical of the YouTube expert?

    Remote learning can be fine for some things, and self learning through informal channels are also fine, but it’s not a full on replacement for formal education in all cases.




  • The first way to use it is with any type annotation: you just use it for documentation.

    # int annotation
    def add_1_to_number(x: int) -> int:
        return x + 1
    
    # callable annotation
    def printer(x: int, func: Callable[[int], int]) -> None:
        results = func(x)
        print(f"Your results: {results}")
    

    These type annotations can help document and make editors parse your code to make suggestions/auto-complete work better.

    The second way to use it is by creating a callable. A callable is an abstract base class that requires you to implement the __call__ method. Your new callable can be called like any function.

    class Greeter(Callable):
    
        def __init__(self, greeting: str):
            self.greeting = greeting
    
        def __call__(self, name: str):
            print(f"{self.greeting}, {name}")
    
    
    say_hello = Greeter("Hello") # say_hello looks like a function
    say_hello("jim")  # Hello, jim
    









  • This doesn’t help for Gmail. I moved to a different part of the country and I have a spam email account that isn’t connected to a phone or second email. Even with the right password, it wouldn’t let me log in because I was trying to sign in from a different location and no secondary way to authenticate.

    Luckily it was a spam email so it was just annoying to recreate some accounts I used for that email, but yeah ve warned.