#python-discussion
1 messages · Page 313 of 1
yea built some projects
You can do that with Flask too then! I’m sure there’s plenty of books, maybe someone else here can recommend some (I am not very intellect)
very different answers here, first is architecture, second is freestyle, and third is both lol
i guess it depends on the person
ok thnx for your suggestion!
im trying to be more mature (in cs and software engineering) but there is a feeling that i hit a ceiling and cant go further
Who uses an architecture, if you know what you want to make then you jut make it
And the level of experience. And the complexity of the task.
There’s a tutorial on their website
And if it doesn’t work the. You think about how it should work
And if that does work, you go back to part 1
but i think ideally, you should get something working first to know what abstractions you need and don't need
ok i'll check it out
And you cycle between the 2 types of thinking till it all works
basically the way the code is structured
every software has an architecture
I bet my software doesn’t
yeah like for some tasks the architecture is already well known
like rest apis
it definitely does
just that maybe it isn't good
spaghetti code is still, in a way, an architecture
Oh I hate spaghetti code
All classes at the start, unless they’re not relevant till way later on
Functions should try to be in the order in which they will be used
That's organization, not architecture.
i usually follow the "newspaper article" pattern, where the important ideas are at the top, and the more concrete details go at the bottom
but yeah that is just organization, not architecture
Idk what you mean by architecture then
Designing APIs and interactions.
Kind of the hierachy of classes or structures or layers
Not the lexical layout of things in your code as such
Easily done. Provides you ignore that fact the every one of your classes subclasses object.
composition over inheritance!
Inheritance can be useful.
most of the time, i only want inheritance because i want shared helper stuff between subclasses
so i usually replace it with the context pattern
I do a fair bit of inheritance, but deep stuff gets harder. Composition using mixins scales sideways fairly well. And composition using embedded things inside the main instance also works fairly well.
How do you do composition in Python?
There are times when inheritance makes sense. When it does I tend to use it. I've seen people go nuts with it though.
First you pick the key and tempo...
nice joke, but don't even start 😭 Honestly horrible advice there I have been given too many times
When?
More seriously though, you try to figure out what each class needs and whether it should be a method or an external function.
Can you elaborate a little on what "context pattern" means here?
Find what feeling you are trying to evoke from the listener, or what concept you are trying to embody, and work from there
Dependency injection
I did a parser for cooklang. I created a base class for the Ingredient, Cookware, and Timing objects since they had enough in common that it made sense to have a base class for them.
passing context to the objects basically
Those seem completely different off the names lol
I can imagine sharing counters, timing, units.
I need to start using python again and learn a whole lot more, but I don't have PyCharm or VSC rn 😭
just do it
Yea
Use whatever works. I just have an editor in one window and a shell in another to run stuff.
They are and they're not. Take a look.
https://github.com/brass75/cooklang-py/blob/main/src/cooklang_py/base_objects.py
I got really annoyed at Windows last night and just started uninstalling every single thing I don't frequently use, and today I've just been sorting out my documents to back up because I'm done with Windows
Today I used IDLE 😭
vim is your friend.
I use nvim but I don't have any plugins or anything at all, so it's just a fancy text editor for me rn 💔
Mostly the same.
I've installed Lazyvim in the past but it's just so maximalist
And I don't really know how to install things for Neovim
so vim, but someone is playing roblox in the other room
There are LSPs for Python you can install. It's a reasonable code editor. I generally use it for smaller things, single file jobs.
Yah ,trying ty as an LSP was what led me to try nvim.
roblox 💔
Roblox in the big 26 😔
To think prime Roblox was 10 years ago
i know it uses some fork of lua
It uses Luau
neovim
luau is genuinely peak
Take a look at https://github.com/nvim-lua/kickstart.nvim @raw bramble @granite wyvern - it's a good starting point for configuring neovim.
scroll up
lua is a programming language. Luau is a polynesian party.
Ooh they updated their website
TIL.
you should use the package manager that Lazyvim uses (lazy.nvim),and start configuring in ~/.config/nvim
I really don't want to just download tools and start using them without understanding them
wdym
I don't really understand how Neovim works, I downloaded it and use it just for the modes. I barely know any commands other than the basic editing ones I need. I want to avoid installing a package manager or anything because all it'll do is introduce me to way too many plugins way too fast which is not what I want
neovim is a more modern version of vim. That's it.
.topic
!pep 810 is one I'm so looking forward to!
how does that help you
505 695 and 701 gang represent
i think you should try out vim first then
I do a lot of CLI tools. It means that I don't need to import everything that all the commands need, I just need to import what the command run needs.
wonder how many years multi-pep support for this command has been suggested 
For !pep?
yes
!pep 1
especially as this topic tends to flood the channel fairly quickly with !pep invocations
pep is a kinda cool thing,better than the C++ ISO
yeah but how do cutting down on imports help you here, if the modules do take long to load, why not just import inside the function and do a check if it already exists before it?
that would be way too much boilerplate
I can do that. And there are places I might consider doing that. But this is letting the system handle it properly.
Yeah, I import everything I need at the beginning of the file.
Lazy imports should also help with circular import issues.
yeah that was the only point it'll help me i think
the literal only library i've loading time issues with is pytorch
tfw when #ifndef INCLUDED_FOO_HPP
the feeling when when
For some things it will probably help with less than half a second of improvement, but that's still faster.
is there a way to make 2 different modules that import one thing in common be imported only once?
I don't think so. I don't think it would be desirable either.
yea that would be confusing to work on
Why is 2 different modules having a thing in common anyway 😭
I think it doesn't parse more than once but it creates objects for each module that imports it, but I'm not 100 sure.
Just make a separate module
What does parse mean
This is the case of 2 files having import foo
In this case it means processing the file and converting it to Python objects.
Oh so just write import foo in those two files no? Create different objects?
Or do you mean to make a singleton?
TBH I'm not sure how it handles it. I'd have to look at the relevant PEPs and the source code.
Ping me pls my phone's bout to die
hey can anyone guide through to learn Python . where do i start and how can i speed up BY using AI.
!res
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
You don't speed up by using ai when learning
using llms or any other type of ai is considered very dangerous for newbies like yourself. they're prone to lying, and you're not knowledgeable enough yet to be able to tell when that happens
You learn by struggling
so my main.py have a object that is passed by to other modules (files),they need the same tools but for different jobs(ex: import an exception of the object)
why are keyword only paramteres not allowed after * parameters?
def foo(*bar, *, baz):
pass
foo(1, 2, 3, baz=4)``` this wouldnt break anything, no?
lol im gonna be real strong then
Module 1 has an object that you want modules 2 and 3 to both access and modify?
In the function header or in the call?
Isn't that invalid python
Does it work?
yes its gonna error at function definition
but I dont understand why that rule is in place, it can just work, no?
if your question is about *, that does work
If you remove the , *, does that fix it?
You can't have a bare *, after ```py
*args
oh youre right, that would be the exact same
yeah
yea,but module 2 and 3 does different things that making them one wouldnt be very cool to work on
So you're wrong it doesn't work lol
also just use backslashes:
"You can't have a bare *, after *args"
??? did you even read what i said
i meant *, is valid syntax, just not in that context.
U said that does work no?
Oh
*, <-- this works
I think if you have a global and then a function that yields that global in an infinite loop it might do what you want? But I'd have to play around with it.
Not after
*bar, *, baz doesnt work
*args tho
nah
#bot-commands message it does work as def foo(*bar, baz=None)
.topic
Suggest more topics here!
It has shown me new perspectives on things. I have learned some nuances (and things) that I didn't know before.
The Mac pyobjc libraries seem to take forever.
The one thing in common is only loaded once.
i might make a dumb question but is it possible to optimize python bytecode when compiling to it?
like what c/c++ compilers does
There has been a lot of work that is going into that. Including more specialized bytecode and the JIT.
That's behind the bytecode, not optimizing the bytecode itself
Like, as a user, rewriting the bytecode won't get your far
It is both... The specialized bytecode helps simplify and make less things.
Take a look at this talk from PyCon 2025 which goes into it somewhat.
https://youtu.be/NE-Oq8I3X_w?si=yQ_ve3tGPF9CahVI
The point I'm making is that: as a user, you can't 'hand write' optimized code
Definitely.
And that specialization is not at compile time, there's no way to optimize early... afaik with how specialization is instrumented
I know. I'm just saying that the core devs have been working hard on performance improvements for everything.
Yup, I'm just being literal about their question
If you understand how certain things are interpreted into the bytecode you might be able to do some things that will result in more optimal bytecode, but I don't think there is a flag you can set (other than to turn the JIT on) that will do optimizations.
That was one of the things I had wondered about, how to analyze / profile specialization
Damned if I know. I just know it should be possible.
Last time I asked, this is what kenjin said: #python-discussion message
Nice!
Ah this logo is better then the previous one
this is the default one
not python: is it possible to allow connection to a postgres for only a specific docker container?
mandatory usecase?
i dont understand
what's your usecase
to use psycopg2 to connect to it from the other container
can you not use them in the same container?
pretty sure this is the default one for the discord server
is there anything wrong with just making a user/password for the container
and expose to 0.0.0.0?
yeah
seems like a bad network security idea
im just going to do a subnet
And expose port 5432 if you haven't changed the port yet
docker ps
9273fca604f5 toy-darts-omop-db "postgres -D /etc/po…" 3 minutes ago Up 3 minutes 0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp toy-darts-omop-db-1
i also added host omop postgres 172.18.0.0/16 md5 to pg_hba
but it's not working
Where are you accessing the postgres container from? The same machine or over the network?
Not in a docker-compose.yml setup?
the docker bridge is working, im getting (172.18.0.3), port 5432: Connection refused
it is a compose setup
If its in a compose setup, then they should already be in the same default docker network. Probably don't need to edit the pg_hba.conf. Just pass the usual postgres credentials
example docker-compose.yml
version: '3.8'
services:
postgres:
image: postgres:16
environment:
POSTGRES_DB: mydb
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypass
ports:
- "5432:5432" # Optional: for host access
app:
image: myapp:latest # Or build: .
depends_on:
- postgres
environment:
DB_HOST: postgres # Use service name as hostname
DB_PORT: 5432
DB_NAME: mydb
DB_USER: myuser
DB_PASS: mypass
i have
networks:
- testing-subnet
```on both
docker network inspect also confirms that both are on the same subnet
hmm
Can you share your docker compose file?
hold on imma push it
i can confirm that i have EXPOSE 5432 on the db dockerfile
oh wait
let me try to add the -i and -h
How do you currently connect from your ingress to db?
give me a moment im just quickly trying this
perfect
turns out just having it inside the pg_hba.conf is not sufficient
you need the -i as well
sorry about that friends
That doesn’t do anything
EXPOSE “advertises” what port is being sued
But if you don’t add the correct --port flag to docker run then it doesn’t actually expose anything.
(it worked though?)

strange, right?
It’s not supposed to
docker is just a jester like that
Did you define the port in your args or your compose.yaml?
this is the CMD: CMD ["postgres", "-i", "-D", "/etc/postgresql/16/main/"]
and compose.yaml is unchanged from the current committed file on github
to up it im just running sudo docker compose up <db-name>
compose.yml lines 72 to 73
ports:
- "5432:5432"```
This does the actual binding
Not sure
I didn’t even know that could go there
So imagine you have 8 different Dockerfile(s) that all run their app on port 8080.
In the first you could put ports: 9001:8080
Then in the second put ports: 9002:8080
And so on and so forth
The ports mapping is where you tell Docker what port to get from the host network.
so i would go to localhost:9001 to access the first app?
Yea
This is just metadata for documentation
https://docs.docker.com/reference/dockerfile/#expose
This is woefully vague and I still don’t understand what it actually does
https://docs.docker.com/reference/compose-file/services/#expose
How do I make a crypto mixer in python
you write the code to perform the tasks that a "crypto mixer" would do.
Hi, I’m learning Python with 100 Days of Code. Happy to join 👋
Hi! welcome aboard 🙂
This doesn’t help
?
You can’t speak proper english
Refrain from speaking to me mate
why do i get the feeling this is the same guy talking to himself?
Mixers aren’t illegal
do your research before talking
Who are you again
Ur an attention seeker move
Nobody cares about you this enough
<@&831776746206265384>
what even is a crypto mixer
I think he meant "miner"
Google exists
Mixer
Lol this is not what a mixer is but okay
Anyone here also doing 100 Days of Code? Would love an accountability buddy.
Mixers are used to obscure the transaction origins, it’s used for privacy matters
You obviously don’t know what you’re talking about
i wanted a TLDR and tell u if its possible or not
seeing that u want to dont give a TLDR , good luck
<@&831776746206265384>
Mixers aren’t illegal in neither the US or EU if no illicit funds are passed through it
He’s just a troll don’t mind him
i can tell
we need more mods with eastern timezones
yeah lol
7 moderators online, not one in the chat rn
Hi 👋
I’m currently on Day 3 of 100 Days of Code.
I’m serious about building strong Python foundations and moving into AI long-term.
Looking for an accountability partner at a similar level to grow consistently.
Daily check-ins + small weekly projects.
Anyone interested?
Can you please stop coping with the fact that you’re poor @silent spindle
We don’t want to hear it
you’ve never touched 4f in your life please stop
lmfao
its hard to find partners like that , 99.99% of the time it just doesnt work out
its better to just start on your own , you can always come here to hang out and chat
dont wait on somenoe
<@&831776746206265384> ableist troll
Can the moderators get on already?
!mute 1462338246775148691
:incoming_envelope: :ok_hand: applied timeout to @silent spindle until <t:1772348203:f> (1 hour).
👍
Also I’m a little confused what is this supposed to mean
What does TLDR stand for
!cleanban 1462338246775148691 troll
:incoming_envelope: :ok_hand: applied ban to @silent spindle permanently.
Oh I explained it
^^
Thanks, I appreciate your advice. 🙏
I’ll keep building consistently.
class Hub:
@staticmethod
def create(
kind: type[EventA] | type[EventB],
) -> Ticket[EventA] | Ticket[Bundle]:
return Ticket[?????]()
#if kind is EventA:
# return Ticket[EventA]()
#else:
# return Ticket[Bundle]()
Any idea what to put in it? The comment version works but i want not to repeat.
Ticket is Generic over T, where T is EventA | Bundle.
Guys i won my first high-school microsoft hackathon today.
I am 13 years old
I got 300 dolllars and a trip to seattle for the national competition
thats very good
congratulations 👏
well done
congrats!
What did you do to win?
and why was it a python program?
THere were two categores: Health, and Finance. I built a ai powered public speaking app that helps you get better.
nice!
wait, which category does that fall into?
and no, it wasn't python. It was SwiftUI and CoreML, and ARKit
fell into the subisdary of health (solving a problem faced by many)
not python discussions some would say
yea sorry
just wanted to share the achievement
np. You are happy to have won. It's fair
np...its not an easy thing to achieve anything
A 13 year old won a 300 dollars price and a trip from a Microsoft hackathon, meanwhile my 45 years old brain getting tortured by some generics/typing in Python.
😭 👍
I am happy for you.
Thank you all!
okay my brain is confused i need someone sane
how many elements are in my_list[1:2]
its ok Aji,
everyone has different path with different achievements
1?
alr ty
Exactly 1 item from index 1
end is exclusive, meaning it won't include the item of end index in the slice
look its midnight my brain doesnt process past first order thinking
remember, just don't include the last one
relatable i am running wild over typing in python.
i could probably work that out but like i dont have the mental capacity at 12:08
set your system clock to 10am, spoof your biological clock
lmao
are you following 'If you need a good sleep, then stay awake'?
i am following "im going to sleep later"
Anyone?
Wait should i post this in #1035199133436354600 ?
i forget python has generics now
it is way better than typevar or whatever used to happen but i just dont write much python now
The comment version is perfect. Here's a shorter version if you're still set about sacrificing readability:
return (Ticket[EventA] if kind is EventA else Ticket[Bundle])()
mypy didn't say there was an issue, when i put x = Ticket() reveal_type(x) it says need type annotation... What was bro doing before ? 
Thanks. I also used overloads on create func. It seems like it just thinks return Ticket() is Ticket[Any] ? Is that healthy?
anyone else love walrus
Overload helps to clarify that passed EventA/B returns Ticket[EventA/Bundle]
Me.
I love [] type parameterization syntax too
feels like am a hacker or something lmao
hi
import hello
you gotta speak more pythonicly i have no idea what this means
Just got fine, thanks to my previous replies. How about you?
!pep 695
way to express generics
Previous repliers*
That doesn't sound right. I feel like it should infer the usage and the parameter types and return type as you pass in arguments
My bad, i vaguely remember the term for it
oh i see i just didnt know thats what it was called
MemoryError
What is "it" that thinks it's Ticket[Any]?
nah walrus is goated tho that was like the first new feature that got added when i started using python and i use it all the time
cuz its useful frequently
Oh never mind Ticket() should just be Ticket[Any]
i see why cant we use a extra line
which is more pythonic
Opps. Wait, i actually ran this:
class Hub:
@overload
@staticmethod
def create(kind: type[EventA]) -> Ticket[EventA]: ...
@overload
@staticmethod
def create(kind: type[EventB]) -> Ticket[Bundle]: ...
@staticmethod
def create(
kind: type[EventA] | type[EventB],
) -> Ticket[EventA] | Ticket[Bundle]:
t = Ticket()
return t
#if kind is EventA:
# return Ticket[EventA]()
#else:
# return Ticket[Bundle]()
t1 = Hub.create(EventA)
t2 = Hub.create(EventB)
reveal_type(t1)
reveal_type(t2)
x.py:46: error: Need type annotation for "t" [var-annotated]
x.py:47: note: Revealed type is "x.Ticket[Any]"
x.py:56: note: Revealed type is "x.Ticket[x.EventA]"
x.py:57: note: Revealed type is "x.Ticket[x.Bundle]"
Is that healthy?
what does overload do. python has method overloading?
I wouldn't say that adding extra lines is Pythonic necessarily
i dont rly think using the extra line is more pythonic
Python 3.8 — late 2019
It's just for the type checker
This is expected... You should use the commented version
It's for functions whose type of parameter changes the return type.
Else why did you care about kind
I actually don't care about kind, it only affects generic T of Ticket and i want to statically type that Ticket[T] will have different T type depending upon the kind's type, the comment version was used due to earlier type errors and was working.
Is the current code healthy and should be like that given I don't care about kind but for type checking only?
why is my algorithm analysis 50hr course finishing in like 30 pages of notes
all the topics feel very small
like this is one module for example The Control Abstraction- The Optimality Principle- Matrix Chain Multiplication-Analysis, All Pairs Shortest Path Algorithm - Floyd-Warshall Algorithm-Analysis. The Control Abstraction of Back Tracking – The N Queen’s Problem. Branch and Bound Algorithm for Travelling Salesman Problem.
thats 4 algorithms and chapter is over
am i not learning properly 
I can't speak L
can you explain? you mean a SAAS product?
What does your project do for premium
You already have a website made?
real-time collaborative coding
class Hub:
@overload
@staticmethod
def create(kind: type[EventA]) -> Ticket[EventA]: ...
@overload
@staticmethod
def create(kind: type[EventB]) -> Ticket[Bundle]: ...
@staticmethod
def create(
kind: type[EventA] | type[EventB],
#x: int
) -> Ticket[EventA] | Ticket[Bundle]:
return Ticket(x)
Well, i actually want to introduce more non related params like x
But mypy yells:
error: Overloaded function implementation does not accept all possible arguments of signature 1 [misc]
error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc]
w interview, etc features
yep
Nice so you are searching for features that you can make premium?
I don't want to spam x every func overload when its not related to typing overloads
It's healthy as far as telling you that your types don't match up, because Ticket() is of type Ticket[Any], which is not the expected return type Ticket[EventA] | Ticket[Bundle]
It wouldn't tell you this if the return type and t's type were switched, but why not just match them to the narrow Ticket[EventA] | Ticket[Bundle] from the start?
no ik im just asking is it worth? cuz will people even use it or not? if someone has done it what were their experience when they got users?
Makes sense but it repeats the code in if-else branches
Well you need one overload with x: int in its signature otherwise the implementation accepts x: int for no reason
Should i just go union over Generic ?
I see
Like Ticket.value: list[EventA | Bundle] = []?
I am kind of unsure when to use Generics and Unions

You could do
return Ticket[EventA if kind is EventA else Bundle]()
``` but idk if the type checker gets this right
nice
Can I ask
you already know that you shouldnt ask to ask
you have been here long enough to know to just ask the question
i have a zip file now if i share that with my friend who uses windows
The packages inside site package or node modules won't work properly ?
Because i am using Ubuntu
send them the source code and have them install depedencies
I did try to make them clone the repository
But they don't have a git account and are very new to software development
They just wanted to edit some frontend html css
of the project
you can share your folder with google drive or any other method
just dont send your site pacakges etc in it
you can also share just the files they want to edit
And they send me the edited file back?
mhm
Expressions are not allowed inside []
I am thinking of shifting to not using Generic
I am spending too much time on fixing this generic
also why did u care if the site packages etc work or not if they just wanted to edit some HTML CSS ?
And i am not sure what's the correct path
I am using react and they are going to edit tailwind I think
They said they want to edit styles
so they want to run your app ?
They wanted to contribute to the project
setup a github repo , have them make a github account , tell them to learn how to use git
i thought this was like , you were selling ur client something
No its a group project
well , you have multiple options
base line is that , you send just the source code , and the other user sets it up on their end and developes
Check out this extension https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare
You can share your current project and terminal, and assign permissions so he can edit files and access terminals, etc.
you dont send node modules and python modules and stuff liek that
Playing Visual Studio Code 
for 80 days
why there is a red line on the whole function and still working but says 'Explicit return statement expected'
Python doesn't require explicit return statements, a function without a return statement will return None, but it's a good practice to include one for clarity.
Is there a self promo section on this server?
there is #1468524576479641744 but its not for literal promotion
it's for promotion literals
Hiya! Decided to start the year off by compiling my Gamechanger Animated shorts into a few progress showcases. It's a good reminder to see the journey stuff like this has to go on! Starting with the most recent P Keyboard, I hope you enjoy the scribble evolution haha.
Final version can be found here: https://youtube.com/shorts/gFU-CqcY4Co?si=E...
ppppppppp
lol
i was learning about functions calls(call stack) and i think i got the basic i.e. python doesn't forget its top function call.
if there is a nested function inside the function call then python will call that function, does whatever is written in it and comes back the main function..
but they also talked about reuturns, which is not clicking in my mind..can anyone help me with this
return leaves a function immediately, back to the surrounding scope
with the value after the return
(to the place where the call was, which is remembered by putting its address on the stack)
!e
def main():
def foo():
if True:
return 1
return 2
a = foo()
print(a)
main()
:white_check_mark: Your 3.14 eval job has completed with return code 0.
1
return 2 is never reached in above
and what about def foo().
it has no data
no parameters, you mean? how does that change anything?
def foo():
if True:
return 1
return 2
is this "no code"?
pass, continue and return all have that same kind of functionality, right?
pass doesn't do anything to control flow, continue goes to the loop header, return goes to the call address on the stack
gotta have the indentity control flow
oh my bad
they all do different things
where the return 2 stands
Yeah, but I mean the sort of jumping out of their scope
I don’t know proper terminology
continue stays in the same scope, the loop scope
well, python loops dont have name scopes, but you get the point, the loop.. block
Mhm
return is specific in that regard as the place it goes to depends on who called the function, not the return itself
that is why the address it goes to is passed in the program as data on the stack
How can you use pass outside of just making sure your code doesn’t break when you’ve not implemented something yet like a function?
you cant, it does not do anything, it is simply a blank statement to put where a statement is expected when you dont have anything better
so it’s only purpose is just to stop my code from breaking till I have the energy to finish it
🙂
there's some interesting uses of pass in if-elif-branches
if a:
pass
elif b:
do_something()
elif c:
...
something like
It's a placeholder which does nothing where syntacticly you need a statement.
i mean, pass is not doing anything specific here, it could be any statement, including like.. 0
What does this do? Why not just have if b elif c?
To only test that if a is false.
if/elif are mutually exclusive, so if if a ran other stuff wont
sure, but it's also a more interesting use case of "do nothing" here
oh yeah I know that 🧠🧠
this is indeed a neat trick to reduce 1 indentation from
if not a:
if b:
do_something()
elif c:
...
Without it the following conditions with if if not a and b and if not a and c. And so on. CUmbersome. I might be belabouring the obvious.
i used to use something like this for parsing ansi, but not anymore
I do this sort of thing everywhere because I hate having long if statements
if (a and not b) or (c and not d)
Just looks horrible
never nester ah code
i just use dicts to avoid lots of elifs
how would you use dicts in this case?
is it possible to make a python interpreter using python
yes
Isnt pass just for not doing anything?
yes
kind-of, but the more things you actually reimplement rather than just reuse, the slower it will be
(specially the object model)
and well you'll still need a python interpreter to run your python interpreter written in python, so it wont be self-sufficient, so if thats a goal then it doesnt really work out
What are classes used for in short
to create objects
Make grouping code and data together easier
What init
constructor i think (i don't use python)
a = []
b = a.copy()
Is this equivalent to ```py
a = []
b = []
b[:] = a
what's the case now
it's like called when you make the class
Thanks
it like defines how you should make the instance and like what vars it should have and stuffs
class Foo:
def __init__(self, name, age):
self.name = name
self.age = age
john = Foo("John Doe", 22)
like this
the result is the same, yes
do they run in equivalent time?
What is self used for then?
Run and find out
....how
the way i see self is you're referring to the object, so like you're basically doing john.age in that example
what does : do
basically the same as [0:-1]
it's a slice
but it slices the whole list
Run the file
but how do i tell the time complexity from that
@pseudo coyote check bot commands
Thanks
You can see the execution speed
the time complexity is obviously the same, but the exact time it takes will be slightly different (just because they go through slightly different code paths to end up doing the same copying loop), but it doesnt matter
imo copy is more direct to understand so use that
or atleast b = a[:] rather than empty initialize and then slice assign
...?
forget what i said because its not python
slices the yoke
<@&831776746206265384> @wise yarrow be messing
!e not that, you can't really describe None for the stop argument with an integer in a way that works for any list, tho for fixed sizes the length works
a = [1, 2, 3]
print(a[:], a[0:-1], a[0:3])
:white_check_mark: Your 3.14 eval job has completed with return code 0.
[1, 2, 3] [1, 2] [1, 2, 3]
What's going on, what do you mean?
wait maybe it wasn't u then who did htat
someone sent like a free sex discord link and deleted it
the bot deleted it
Ah, that was someone else. Our bot deleted it and banned them
mb maybe they had like a similar username
why would you think stickie do that 😭
bc stickie was the only one typing lol
Poor stickie
can you use complex numbers as keys for a dictionary?
yes, why not? they are immutable, and consist of hashable parts (floats), so obviously they have a stable hash
... Paste+send doesn't show as "typing"
sure, i do it all the time for AoC problems
that's prbly what happened then
Python as first programming language and what second? Should i learn C (i will need to learn it anyway in school)
I recently discovered tuples can be used as dict keys
anything hashable can be used as a dict key
do you just have to type ur message as quickly as possible and then edit it like 5 times lol
Sure
yes
i looked out the windows for 3 seconds...
and for stdlib types, if something is immutable it's probably hashable? I can't think of any counterexamples immediately at least
What does .append do
adds a value to the end of the list
appends to the list
round(num,2)
!d round
round(number, ndigits=None)```
Return *number* rounded to *ndigits* precision after the decimal point. If *ndigits* is omitted or is `None`, it returns the nearest integer to its input.
For the built-in types supporting [`round()`](https://docs.python.org/3/library/functions.html#round), values are rounded to the closest multiple of 10 to the power minus *ndigits*; if two multiples are equally close, rounding is done toward the even choice (so, for example, both `round(0.5)` and `round(-0.5)` are `0`, and `round(1.5)` is `2`). Any integer value is valid for *ndigits* (positive, zero, or negative). The return value is an integer if *ndigits* is omitted or `None`. Otherwise, the return value has the same type as *number*.
For a general Python object `number`, `round` delegates to `number.__round__`.
Kinda off topic but is c, c++, c# almost the same? Like if i learn c will i be easily learn those?
prbly did it wrong
no, they are not even remotely "almost the same", but they do have some overlap
I see
i believe c++ is a superset of c but i think c# is completley different
Thanks for the info
(a non strict superset, there are loads of c code that wont get compiled by a c++ compiler and you dont even have to try hard to do that, just dont cast malloc for example, in C void* <-> T* is implicit unlike C++)
yeah okay
i was using arduino the other day and i couldn't tell if i was learning c or c++
arduino is C++ but you specifically might only be using C stuff
but maybe i'm just mad
there's some syntax similarities, but imo they write completely differently
.topic
Suggest more topics here!
You still have the float shenanigans happening in the background.
round(0.1, 2) + round(0.2, 2) will still be 0.30000000000000004 because even with rounding, those numbers can't be stored as their exact value
What’s the coolest sht you guys have made
What’s it like being neither genders
I made a advanced calculator that can do arithmetic operations
No hate
That is offtopic for this channel. If you genuinely wish to talk about queer stuff, tag me in offtopic
i made gloop which is a simple interpreter with 5 "gloops", which are:
print the current value
add a gloop to current value
add a gleep to current value
2 more which are same as above ubt instead remove
Sorry, but how’s that different to a normal calculator
it's more advanced
Because its advanced
Yh mb
tic tac toe
No I sleep now it’s 5am
concerning
I am going to study travelling salesman problem
I saw a small video and i don't understand anything 😞
Fellas what IDE/Code editor do yall use?

Hello. How do I use a third party library? I am new to python specifically.
peak
Using a package manager like pip
i was using vscode with the vscode-neovim extension, but the extension downloads became unreachable from russia so i just switched to using neovim
vscode is genuinely so peak
Yeaah I feel that CDNs are broken in russia. Same for me I use the Lunar Vim distro of NeoVim
Zed https://zed.dev
All valid honestly
vscodium
:0
i got most of what i'd want from a "neovim distro" from https://github.com/folke/snacks.nvim without actually giving up my config fully to it
Ooooh thats nice!
Using Linux and Neovim taught me some best practices for python
Oh hell yeah
not even neo?
Nope, I don't see why I would switch
inb4 ed
who is that one Ed who edits everyone's text
how is he not tired
I tried ed with rust once and suffice to say it was not fun
aseprite text tool
I used to use pycharm, but ever since I've setup neovim for python dev I've been way too used to neovim to switch back
bit late bit I use IDLE
Anyways, I can't seem to escape vim (on termux)
:q
my neovim navigation skills are lacking tho
I did try neovim on my laptop and I broke it
Interesting
so I went back to IDLE
Primeagen has a vim game I think
Oooh
I used IDLE for my first python project in school
I'm so glad I never have to use IDLE again
I do really like IDLE and it does everything I need to do
The reason I'm considering hopping on python in the first place is because of the brevity
Compared to... c
I am facing issues in running my python code in visual studio
Which environment to choose for
Have you tried Thonny?
The program won't run
The terminal opens, shows the path stays there freezed
That's a good reason
I kinda want to have fun first before I go fast
I wish for loops allowed expression in their assignments: ```py
for x in range(5):
print(x)
0
1
2
3
4
But you could also do ```py
for x+1 in range(5):
print(x)
>>> 1
2
3
4
5
The joy of actually having a finished piece of software
Does this server have a bot that runs python code?
that seems really odd. You also can't do x + 1 = 0
?
x + 1 = 0 -> x = -1
You don't necessarily have to choose. Python can be as fast as you need it to be for many real-world applications.
for loop is assignment on repeat, so for SOMETHING in .. works if SOMETHING = .. works.
this is not what your example does, by the way, its not solving for x in x+1, its adding 1 to the value in the iterable and that is what it assigns to x
well then for loops should solve algebraic equations
Yes
we can debate what the word "should" means there...
!e ```py
print("hello world")
:white_check_mark: Your 3.14 eval job has completed with return code 0.
hello world
Assignment isn't commutative
But only staff will see the output in this channel
Other people using it will have their output redirected to #bot-commands
for loops need to solve algebraic equations
they need to solve algebraic equations such that no human has ever solved before
it alarms people, but you can do this:
nums = [1, 2, 3]
for nums[1] in range(3):
print(nums)
Iterate over items specifically
this really just doesnt work out with more complicated expressions
they need to determine if every statement in this universe is true or false
you need to come back down to earth 🙂
and it just assigns the 2 to each of 0, 1 and 2?
Wait are walrus expressions valid on the left hand side of assignments?
nums[1] is the assignment target (the thing that will be assigned to), not the value that is assigned
every for loop must be able to determine if it will terminate or not
yeah I know
this does nums[1] = 0; nums[1] = 1; nums[1] = 2
yeah that's what I meant to say
no
Yeah I just checked
(x := 2) is 2, so (x := 2) = 3 is like 2 = 3, which doesn't make sense.
i've done something like:
for texture[:] in colors:
display_texture(texture)
Right
if you apply the same logic to your previous example it doesnt work out
i mean, you get:
nums[1] is 2 so for nums[1] in range(3) is for 2 in range(3)
i've used for d["page"] in range(10):
true, it's difficult to explain briefly
using a dict is fun
would it be confusing for python to bring back the goto from basic?
No I think it uses the second item slot to keep all the iteration objects instead of in a new variable
it would be if it used line numbers like basic
if it used labels though?
!pypi goto
yes, because this explanation is wrong, the assignment target is not evaluated, its a different kind of code
Oh okay yes I see
goto that would go between scopes is cursed, goto in 1 scope is fine
problem is each assignment to a "new" local variable is like a new scope but not really
between scopes is confusing more than anything
damn that pep is almost as old as i am. its like, 3 weeks short
I've occasionally wanted to break out of multiple loops at once.
But in those cases my code's been in a big mess anyway
it's older than I am
You're way younger than I thought you were
i was older than yall when this pep was written
was? are you no longer older than us? did bro stop aging?
salt die are your parents older than you
not yet

I know someone who's younger than their niece
Dice do not age like humans
"way younger"? how old did you think i am, like 30? i thought its quite obvious that im basically a kid
can i ask a non python question here..
what i am doing is very cumbersome
You're so much wiser than me for basically a kid
Look at you FP master
If it has absolutely nothing to do with Python maybe one of the off topic channels will do
!ot not in this channel, but you can in the off topic ones
Please read our off-topic etiquette before participating in conversations.
i actually consider my wisdom stat to be insanely low im making stupid life decisions
i just read' a couple things about programming thats it
You're more impressive than you realize
so not a cleric or druid
Do you know about antigravity?
can one even be called an fp master if they are not actually making any projects
sorry i dont know the basements and lizards class chart 😭
prbably not a monk either

but wis is a dump stat everywhere else, so could be anything else
what class would diogenes be
i want to be that
No
Do projects if you feel like it but I wouldn't say it's a prerequisite because you already prove yourself when talking about FP in this server
i feel like monk, but maybe, like, homeless rogue
FUCK
of course this joke has already been done
nothing ever happens
nothing new under the sun
The line is blurry 💀
what's an FP master
well diogenes had like 22 wisdom
i feel like KISS isn't emphasized enough
Formidable Python
some people just like to spam design patterns

its a title a person who spent time on bullshit makes up to feel better about themselves
I'm kidding it stands for functional programming master
you haven't made a sentence factory for this sentence to exist
nvm
ah so kinda like those people who spend time speedkubing
I think none of the software engineering acronyms make seense (e.g., KISS, YAGNI, ...) no one decides things in a vacuum, everything is situational 🙂
clearly i have to inject an abstract ISentenceFactory
the other end of the spectrum would be SOLID
most of the time, where do you want to be
at home?
oh sorry, wrong interpretation
lol home is good
me, personally, i prefer to be outside
but unfortunately coding outside is ehhh
clearly a SOLID enthusiast with 99 years of experience
that's just the average java developer
Personally my style (at work) is that I don't like making "big bets" on features or architecture. I push things out ASAP, get feedback and iterate. Eventually your abstractions will no longer fit the direction of your project and then you rewrite (some of) it
that thing runs discord btw
a custom discord client written in grasst, the good brother of rust
so, KISS then?
what is P NP NP HARD NP COMPLETE
pretty much dont abstract until you need it
words and acronyms written in capital latin letters
what are*
Idk why but it reminded me of PPAP
PPAD is a class too
i mean why should i categorize problems i don't even understand them
Yes and no - sometimes you already know that a feature needs to be more complex than your baseline because of certain functional/non-functional requirements, and then you break "KISS" and "YAGNI"
tf is yagni
If you like the simplicity of IDLE, Thonny is also a Python IDE designed for simplicity, but in my opinion superior to IDLE.
you aint gonna need it 🫠
i mean i think the https://en.wikipedia.org/wiki/P_versus_NP_problem page does a good job at explaining
but if you think this is just useless theoretical stuff then you are half right, it wont help you solve any of your problems, it will just give you insights on what kind of problem you're dealing with computationally
but couldn't you argue that you do "need it" then?
In a way yes
where did you read about P vs NP?
But yeah, I think a lot of our profession is about predicting the future (with the abstractions we use). I like predicting nothing and then doing rewrites when needed
but your organisational culture needs to allow for this ofc
You keep it as simple and stupid as is possible given the available information, basically.
that's true
In some places rewriting is an absolute no-go, then I'd do things differently
I want to take an input image (.png), split it into a grid, output the images in the grids. Not sure where to start
my university syllabus
So you want sub-pictures?
I generally like to do a mix where the architecture is modular and flexible enough to avoid big rewrites, but the actual implementations are as simple as they can be
These concepts usually come up as part of an introductory course on the theory of computation at uni, and it's a lot easier to explain (P, NP, NP-hard, NP-complete) if you have the foundations from that course.
alright
An answer to the P versus NP question would determine whether problems that can be verified in polynomial time can also be solved in polynomial time. If P ≠ NP, which is widely believed, it would mean that there are problems in NP that are harder to compute than to verify: they could not be solved in polynomial time, but the answer could be verified in polynomial time.
whats the point of verifying output and categorizing them as NP.
The problem has been called the most important open problem in computer science
what problem NP == P ? i cant get that
and what is this NP hard
In "corporate programming" this is unavoidable because eventually someone will bring features that go against the assumptions that your abstractions make
we already had TOC this is not TOC
Yes, it is?
toc talks about Formal languages
guys what is the best GUI framework for python that looks good ? i want to make a simple GUI
i'd just like, think how to split the rectangle into a grid of other rectangles, what the bounds of those rectangles would be (which would end up just being dividing into equal pieces with the usual division)
then find a library to load an image into an array and then do this array splitting and then save it back to different pngs
https://stackoverflow.com/questions/5953373/how-to-split-image-into-multiple-pieces-in-python
not problems
But yes, I also try designing things to be modular with simple implementations. Rule of thumb is an interface with an implementation and having none of the modules depend on other ones
Yes.
Unrelated, but part of why I'm considering python is so that I don't have to spend a lot of time dealing with project setup and linker errors
ToC is not only about formal languages.
this is a part, do you know about non deterministic turing machines?
Yeah like in my current project if I want to switch from a pull based scheduler to one that does up front graph analysis I just need to rewrite the scheduler and node implementations, the API wrappers and compiler can stay untouched. But for now pull based is the simplest option and it works
.
i want it to look modern
ah i think what we learnt in uni just taught us Formal languages as TOC. since it deals with automata, computability and stuff
this does not feel like that
Okay, what is this library in question?
As for the other statement, I know. I put it up because it is funny.
yea i remember that in tm but i actually forgot that
What about complexity theory?
it's a diseased rat named Keith with his leg blown off
we learn that in another subject called algorithm analysis
I look at it like the ship of theseus 😄 you change 1 small part at a time (no big rewrites) but after doing enough of these you've probably changed everything
looking at algorithm classes from the perspective of turing machines often make way more sense
guys
Alright, well, do you know what polynomial time means in the context of complexity theory?
i think people usually use PIL to deal with images in python
split it with any other restriction? just some regular division?
yea i think it just means n^x like n n^2 etc
What lambda said.
I think you can use just Pillow for all of this. Personally I would parameterize the number of rows and columns you want to slice and slice relatively to the size of the source image, but I don't know if you need each sub-picture to be in certain dimensions
Right. And do you know the difference between solving a problem and verifying a solution?
no thats something i came up with today. what does verifying mean just looking whether the output is correct?
how can not a single person know
why do we learn that
does verifying mean just looking whether the output is correct?
yes
It's verifying whether a given solution solves the given problem or not. I. e. you get handed a solution and you check if it's a correct solution.
PySide6. You can make simple GUIs with it and you can make look very modern. So can tkinter and maybe custom tkinter if you prefer that, but I guess you're staying far away from tkinter
It's a different task from coming up with the solution from scratch, and it can have a different complexity.
using a automata?
Using anything.
i'm curious. imaging that i have a old keyboard with no customization app. Is it possible to make a app that customize the keyboard keys
why do we learn anything?
do you have an example of something made with it ? or how the default widgets look ?
i tried tkinter and it looks so old , i want something better
I'm sure there are examples on the internet
i mean we learn about TC because it helps us to study algorithms but this does not makes sense. we are making sure the answer we got is correct?
we can just look at the output
You can style tkinter apps with... Styles in themed tkinter. And custom tkinter doesn't look that bad but I figure it's just as rigorous
and why do we prove this
So some problems have a known non-polynomial complexity for solving the problem, but a polynomial complexity for verifying a solution, like 3-SAT.
if you care about the time complexity of an algorithm in general, why would you not care about the time complexity of an algorithm which verifies a solution? is verification just.. not interesting?
pyside6 looks ggood , thanks
do you have any good tutorial for it ? or should i just google and use whatever ?
if I hand you an answer and hide my algorithm for coming up with the answer, you should be able to tell me if my answer is correct in polynomial time (sudoku is an easy example if you don't know about sat solving, there are problems which don't fit this ofc)
what's the time complexity of explaining this problem
Not always. With Traveling Salesman, you can't just look at the solution and know if it's correct.
There's something hold on
The output is a path, but you don't know if it's the shortest path or not.
O(n^n)
NP are the ones which can be verified in polynomial time right.
then i see things like hard NP NP complete
O(h, i dont know)
what do they mean when they say when a problem is hard
the version they use is to check if some path is less than n
checking is fast, finding such a path not so
Yeah, that's a variant with P verification. I was mainly just explaining how verifying isn't necessarily easy.
I might try it thank you
This is no official documentation but it's a good start: https://www.pythonguis.com/pyside6-tutorial/
The official Qt docs are good, just they're for C++. When you need to use those, keep in mind the naming is the same but the syntax is different.
Oh, there are official PySide6 docs: https://doc.qt.io/qtforpython-6/index.html
They don't just say it's "hard", "NP-hard" is a specific term with a specific meaning.
i think general computational hardness just means "more than polynomial"
yes i got it i think, we check our answer is correct or not.
so sudoku is NP ?
yeah essentially
yea what i see is that "If every problem in NP can be polynomially reduced to NP hard then its NP hard for example travelling salesman"
but i don't understand this sentence
It basically means, if you can solve that NP-hard problem in polynomial time, then you can solve all NP problems in polynomial time, because you can transform all NP problems into your NP-hard problem in polynomial time and then solve it.
thank you very much bro you are the goat
You're welcome, thanks
So solving an NP-hard problem in polynomial time is a shortcut to proving P = NP
technically P = NP is always false
guys are you talking about semiconductors ? i am just hearing P and NP
what we want to prove is NP = {}
huh
No, I don't think that's true.
what is P and NP
NP - non deterministic polynomial (time)
huh
NP is the class of problems with proofs verifiable in polynomial time.
We already know it's not empty.
we want to prove NP \ P = {}
Yeah, which is equivalent to P = NP
I think?
everything P is already NP
yes
yes, since P is a subset of NP
P is a subset of NP
we know NP is a super set of P, we want to prove if P is the only set NP contains
aight i see i need to jump in, there is decidability and undecidability ...kay? (let's ignore semi-decidibaility for now, that's a special case)
so a problem is one of 2 ...decidable of undecidable..k?
all ez probs (ones that can be solved fast are called P solvable problems)
so these ez probs are all a subset of harder problems called NP problems (gg problems)
now these gg problems have legenedary tier (decidable) and god tier players in them (undedicable)
the undecidable ones are called NP-hard problems, the decidable ones are called np-complete ..
Deterministic polynomials are a subset of nondeterministic polynomials? Do I have this right?
e.g. suduko.
although solving it is difficult (NP),
verifying it is rather easy, which usually takes "polynomial time" (P) or less.
like O(n¹), O(n³) or any O(n^k) for example.
decidable just means can the algo give yes or no as an anser to a question
huh
Hey everyone 👋
I’m Avi, currently learning Python. I’ve completed the basics (syntax, loops, functions, basic OOP) and now I want to level up from beginner to strong intermediate.
My goal is to get solid in python eventually move towards data science + ML.
'does this C++ program compile' is undecidable, for example
Hey! I liked the book "Fluent Python", maybe you'd like it too
i think i'm misinterpreting all of it so it should definitely be phrased better if it's correct at all
it does, because turing undecidable problems are np hard - eg halting problem or diophantine eqs
because of comptime (const..eval? constexpr? what do they call it) and templates?
halting problem isn't np hard
it's the quintessentional example of an np hard problem
h u h
it's very literally undecidable by computation aka a logical paradox which can't be computed by any algorithm
NP hard problems can be computed even if inefficiently
templates specifically.
Do you know sheafification of G?
the youtuber? yeah
https://youtu.be/cFtymODJEjs ?
i didnt watch it
he made an interpreted language within the C++ compiler
using templates etc.
atleast what i thought, turns out i'm wrong but i'm also interpreting all of it wrong
he also made world's best guide to Python
that's false, cook levin says np complete can computed, if np hard is solved in p then all np complete problems are solved in p because you've solved an undecidable problem, and by proxy solved np complete since all np-hard problems are more expressive than np-complete
lol yea
c++ templates are just a bad functional programming language
just like Rust types
NP-hard problems can't necessarily be computed.
Some NP-hard problems can, others can't.
that's false, cook levin says np complete can computed
i do agree with this
if np hard is solved in p then all np complete problems are solved in p because you've solved an undecidable problem
not all np hard are undecidable. if you solve halting problem, it's np hard because it's undecidable, it's like solving a far harder problem than you need to show P = NP
rust traits are just a bad prolog
and haskell typeclasses
holy shit docker prune Total reclaimed space: 16.25GB
Yes, I don't think NP-hardness has anything to do with decidability.
what?
i agree, by i guess tsp is np hard and isn't undecidble
NP-hard means
for every problem L which can be solved in non-deterministic polynomial-time, there is a polynomial-time reduction from L to H
16GB, the amount of space needed for a single picture of your mom
my server has crashed twice because of disk space being eaten my docker logs 🥴
NP-hard problems are just problems that can be reduced to from an NP problem in polynomial time. It says nothing about how hard it is to solve.
every NP problem can be solved by a computer with sufficient memory in sufficient time
It could be uncomputable.
that would be a small human actually if you want an accurate picture
if you want each (surface) cell to be visibile
NP-hard != NP
The first time it was me being naive and not knowing this was a problem, the second time around I have a grafana setup and alerting but my sendgrid API key had expired in the mean time lol
ur mom so small...
lol
NP-hard means, if you can solve a NP problem in time T, you can solve it in p(T) for polynomial p
pixels are a low quality approximation
scans ftw
Yes, it does mean that, but it doesn't only mean that.
In computational complexity theory, a computational problem H is called NP-hard if, for every problem L which can be solved in non-deterministic polynomial-time, there is a polynomial-time reduction from L to H.
i'm making an image hosting service and i would like to know how i can add verification checks to uploads, to make sure that the received upload isnt a binary file, just an image
This doesn't specify if H can be solved at all.
what is the distinction?
Just that you can reduce an NP problem to it.
you can check for well-formed PNGs and remove all unnecessary chunks
every NP problem can be solved by a sufficiently powerful computer
so PIL.Image.verify()?
even the halting problem?
But NP is a subset of NP-hard.
the halting problem is not NP. it's undecidable
The halting problem is not in NP.
i thought it was...hmmm
if you can solve every NP problem any amount of times, you can solve every NP-hard problem.
yea we classify them based on whether it can be solved and verified
the easy problems can be solved in polynomial time so that means its verification is also polynomial
the NP problems like sudoku can be verified easily but its hard to find the answer with some fixed algorithm (but can't we do something like checking all possbilities like bruteforce that solves it)
so that question asked in the wikipedia P vs NP means. "are all NP problems which can be verified P problems" ?
No? Why?
apparently you can have decidable problems that are not polynomial time, TIL
and then as a follow-up project, storing binaries in pngs
halting problem is a paradox in the true sense of "this sentence is false, figure out the truth value of this statement"
interesting...
every NP-hard problem can be solved by solving a NP problem a polynomial amount of times
by a binary i mean an executable file
How is that?
it has to be solved by solving it a particular number of times, right?
i don't think it's very helpful for finite systems either, determining if a turing machine with a finite number of states and memory cell halts is exp time complete iirc
oh wait I think I messed up the order
and most of our real systems are finite
wait
all of them are
idk i don't wanna trigger some quantum computing dude
the observable universe is finite and i dont think we have systems outside it
we def can't interact with them
Like, perhaps it's not very interesting, but technically you could reduce for example SAT into the halting problem.
So the halting problem should be NP-hard.
that's stretching the word "reduce"
but is it NP-hard?
NP HARD MAY NOT BE NP SINCE THEY ARE HARD AND CAN BE EXPONENTIAL TIME for verifying
Does the heat death of the universe not solve the halting problem? Every program will end, whether it’s designed to or not
maybe something will warm the universe back up
Definitely solves cold booting fr
a space heater
so one can die from being too hot
computer scientists live outside the bounds of reality
they can run their turing machine forever in violation of 2LOTD
a hair dryer

