#python-discussion
1 messages ยท Page 511 of 1
I mean, it depends on the book and author.
I think you need to upgrade your understanding to the 4.5e edition of books
Someone please know where that number comes from
"2nd edition" always means, "use this one instead of the 1st edition". If it was a sequel, it would be called something else.
alright, so my understanding of the world is still somewhat intact
it looks like Kleppmann revised the structure of the book quite a bit
Writing Data Intensive Apps 2: The Phantom Menace
Oh wait 2 was the attack of the clones lol
im actually gooint to the capital tomorrow, ill stop by and see if they indeed have 1 copy left of the second edition
Hey Guys, is there any Website where you can complete some small python tasks/scripts/fix small bugs and get a small Payback?
you do realize people do it for free here?
They want to earn money methinks
why would people use that platform instead of just asking for help online?
with the consideration that it's just a small task
I mean i want to help with small tasks and get paid a small amount
You must be new to the internet
here's an idea, you make an "AI" service that fixes bugs... in reality it's just this
Too late
That idea has already been stolen
https://ia.acs.org.au/article/2025/the-company-whose--ai--was-actually-700-humans-in-india.html
Actually Internet chatters
yk, ideas can be stolen more than once, they don't have a borrow checker unlike rust
unsafe {
copyright.violate();
}
"reading does not conflict"
immutable references can't stop me because i can't read
hmm, ideas are immutable, aren't they?
you'd better hope not, or there is little hope for humanity

the real question is: is the Ship of Theseus mutable
humanity is immutable, aren't they?
would there happen to be a cleaner way to generate index-ish IDs for entries in a sqlmodel.SQLModel table?
def create_item(session: Session, item_body: ItemBody):
last_id = len(session.exec(select(Item)).all())
item = Item(
id=last_id,
name=item_body.name,
price=item_body.price,
expiry_date=item_body.expiry_date,
)
session.add(item)
session.commit()
session.refresh(item)
return item
I was using itertools.count but this fails some tests of mine because the counter state persists across different tests
# counter = count()
class Item(SQLModel, table=True):
# id: int = Field(primary_key=True, default_factory=lambda: next(counter))
id: int = Field(primary_key=True)
name: str = Field()
price: int = Field()
expiry_date: date | None = Field(default=None)
no no, every time you come up with like an improvement or whatever, it's a new idea, it's like versioning but for ideas
damn, gotta write an RFC for versioning of ideas
No advertisement is allowed here
At most, you can advertise your open source projects at #1468524576479641744

what?
how can I install Python 3.13.13 in Debian?
you use uv
anyone studying in LUND university sweden?
you can use uv.. but if you want a global python i recommend pyenv
The bestbian lesbian ๐
you still use uv
you can override the PATH
and make uv's pip install user-wide instead of system-wide
it supports setting a global python (well, it doesnt "support" it but you can override the PATH yeah), but not global dependencies very well
can these override python installed by apt?
Thats not an advertisement
or just use uv pip, it launches a user-wide venv
It is, you're advertising yourself to be hired.
uv won't mess up the system python
These things are virtual environments, it's the recommended way to dev in Linux overall.
no
Im not i asked if people know a website to find small tasks to do for money
and should I uninstall apt python after installed uv?
Did you see my answer in career discussion?
Oh, then sorry, I thought you asked if we had those tasks for you.
Not necessary
#editors-ides message
i was facing this issue in the past
Yes
no, your system likely depends on python for a lot of things
i use uv for my projects, pyenv for managing my pythons
i see
Then you'd break anything that uses python in your system.
I was using itertools.count but this fails some tests of mine because the counter state persists across different tests
can't you just patch counter to be a new instance for each test or set it in setup?
though a counter like that would also be a danger for multithreaded or multiprocessed environments
uv can do both
If you want something more up-to-date you should use Debian Sid or another rolling-release distro like Open SUSE tumbleweed.
i was facing issues in the past with uv and a global python
#python-discussion message
you know about autoincrement?
so...... there are linux apps run on python?
no
Of course lol
trixie is not the newest now?
though a counter like that would also be a danger for multithreaded or multiprocessed environments
could make it a contextvar
That's the unstable branch of Debian, it's more up-to-date.
It's like Arch, rolling release.
index-ish IDs are weird anyways
The adduser script runs on Python, for example.
arch does some testing before releasing software though. debian sid is where you test software before releasing, so it breaks. sid is more comparable to the arch upstream, if anything
can you use uuid
Well, yeah
trixie is just the newest stable?
Yes
yes. just keep in mind that debian keeps older versions of software in order to be stable
ehhh, maybe, but I'd follow fix error's suggestion of using an auto-increment (pretty sure it's just an SQL-ish feature (presumably implemented by the DBMS))
See this: https://sqlite.org/autoinc.html#summary (or the equivalent documentation if you're using a different database engine)
If this is your table: sql create table fruits ( uid integer primary key autoincrement, name text not null, count integer not null ); then uid becomes an optional field that increments on each insertion. So you can do insert into fruits (name, count) values ('banana', 42); and it will pick the next available uid automatically.
I would recommend interacting with an SQL database directly before jumping to ORMs and other tools that wrap them. But it looks like SQLModel does support automatic ID generation: https://sqlmodel.tiangolo.com/tutorial/automatic-id-none-refresh/
Debian releases a new version every x amount of time, I don't know the exact time, but it makes it pretty outdated compared to other distros
But also makes it insanely stable.
mm thank you
can you imagine, a language that doesn't support trailing commas (also Java, hate that about it, too)
yeah, but again that would be persist across the tests.. i could patch them with a fixture i guess, not that it would matter if it were persistent in the case of uuids
but anyways, auto-increment is the way
what are you checking in your tests? Maybe they need to change
haha the colorscheme is different for the database tutorials
seems apt don't allow me for installing uv......
well, i was testing if the index-ish IDs were being generated properly. of course, i wouldnt be doing that with uuids
why was i trying to make the IDs index-ish? i dont know, im just playing around
def test_item_id_generation(client: TestClient):
for i in range(10):
response = client.post("/items/", json=test_item_body)
assert response.status_code == 200
assert response.json()["id"] == i
response = client.get("/items/")
assert len(response.json()) == 10
Is this an actual requirement for the project? Or an implementation detail?
you can probably do the "standalone install" by downloading the installer from the uv website and executing it in the terminal
you can give this a shot https://docs.astral.sh/uv/getting-started/installation/
instead you might want to test that the 10 responses have 10 different ids, and not care what they are
im working on a hypothetical inventory api for the means of playing around with fastapi as i was curious to try it out, the requirements are vague, apart from "by trying to add this i should learn something"
anyways, the automatic id generation works
also, when testing these kinds of things, it can be very helpful to reset the state of the world between tests
yes, i do that with fixtures
@pytest.fixture
def client():
engine = create_engine(
"sqlite://",
connect_args={"check_same_thread": False},
poolclass=StaticPool,
)
SQLModel.metadata.create_all(engine)
def get_test_session():
with Session(engine) as s:
yield s
router.dependency_overrides[get_session] = get_test_session
yield TestClient(router)
router.dependency_overrides.clear()
where is the data stored? You said the tests were affecting each other.
hello peoples
yes well, if i were using uuids. ill probably switch to that now for a different table, to try those out as well
You have to run their installer on Debian
curl -LsSf https://astral.sh/uv/install.sh | sh
even if you are using numbers: you don't care what the numbers are. The test is too specific.
Or add the community repo
no, that was because i was using a global counter before for the ID generation which the above fixture doesnt deal with:
counter = count()
class Item(SQLModel, table=True):
id: int = Field(primary_key=True, default_factory=lambda: next(counter))
i could patch this too with a fixture but.. yeah, anyways. auto-increment is the way to go
well you would if you were making index-ish IDs, i suppose
but i wonder if there's any actual use case in using index-ish IDs
i just did it because... well, that's where my mind went. id probably use uuids for all practical purposes
even if there were a use case of index-ish IDs, it should probably be a different field, and the actual id be a uuid
uuids for most apps is kinda overkilled
is it? seems kinda basic to me
It's a good idea to avoid relying on implementation details when testing. That way, you won't have to rewrite the tests when refactoring the system.
Identify the actual requirements for the feature and test them. For example, here's what I'd expect from a basic system that supports adding and listing some generic items:
- the generated items have unique identifiers (the client of the API doesn't need to know how they are generated)
- after receiving the ID for the item, you can then grab the item by that ID
- after adding an item, it will be present when asking for a list of all the items
- IDs are unique, meaning they are not repeated ever again, even if other actions take place in your system.
So you might create a test for each of those. Testing number 4 will be difficult and/or impossible
You could force number 4 there but there's little value in it from what I can see. You'd be testing the failure route of an insert which should be covered in a different test.
c developers /j
yes, these are better
testing number 4 well... ill leave it up to the auto-increment technique author
wdym basic? if you are using any kinda orm that works with any database, the uuids are automatically generated by the orm so I dont see the benefit of uuids over int, except more taking up more memories
non-incrementing IDs can work as a defense in depth to protect against enumeration attacks
So, guys, I can make pretty much the same stuff in C and in Rust but Rust is easier? I think that I still don't understand the relation properly.
the maximum value of bigintfield in Django is around 9 billions iirc
I suppose you can generate random 64-bit numbers as opposed to 128-bit UUIDs
that is true
C requires you to uphold a lot of invariants yourself, whereas Rust makes them part of the language.
do you think your app need to generate this many instances ?

In dumb friendly terms?
Or an example?
C requires you to think more and lets your code fuck up, rust does the thinking for you and forces you to address issues
Made something practical today , Image Resizer hehe .. using Pillow.
but it's not about number of cases, if you want a unique identifier a uuid is simply better than using integers
if you want to identify rows by some integer value, like rank, that should not be the id it should be some other field like "rank"
unless im not getting what you mean
You could repeatedly add and remove items and see if the IDs repeat. Here's an example footgun I'm thinking of:
https://sqlite.org/autoinc.html#summary
If the AUTOINCREMENT keyword appears after INTEGER PRIMARY KEY, that changes the automatic ROWID assignment algorithm to prevent the reuse of ROWIDs over the lifetime of the database. In other words, the purpose of AUTOINCREMENT is to prevent the reuse of ROWIDs from previously deleted rows.
so if you don't specify AUTOINCREMENT, the IDs will look like they're unique since they're just incrementing forever, but they're not
Rust sounds better for dumb people like me then
What does C do better than Rust?
Don't tell yourself that you're dumb.
If you need to work at a low level, like implementing an operating system.
idk, other stuff is fairly compatible with C
it compiles faster (because the compiler doesnt do as much) [different from compiling to faster code]
And even like that it's used in the Linux Kernel, interesting. I wonder what they use it for
rust has C FFI
mmm, isn't that exactly what Rust also supports
Feels like an overly aggressive test that is reaching into a space outside the scope of the implementation. Maybe I'm thinking of it from the wrong angle. I suppose it could cover the CREATE queries.
that sounds like a win for C then
I don't think I understand you, what do you need the id for, how is uuid beter than int in terms of being unique?
C FFI means you can also go Rust -> C FFI -> language of your choice which supports C FFI (basically all of them)
yeah and you're dealing with C anyways
Well, if I believe I'm dumb, I don't get mad at myself when I make dumb mistakes, but also force myself to do more because if I'm not talented, at least I'll be hardworking!
Afaik, rust is "low level for the sake of high performance", whereas C is "low level for the sake of operating at low levels of abstraction".
not directly
rust is whatever "level" you want. the source code of most userspace rust apps is pretty high-level,
but you can drop down in case you need to
Oh, this sounds pretty cool ;0
In your usage, is talent something that can be cultivated, or only something that's innate?
I don't know whether I should make a portfolio website or learn how to make games, which one should I do?
You can put games on your portfolio website, no?
Yes, but I haven't made the portfolio website...
So should I make things that can go on the portfolio or should I make the portfolio itself?
sure i mean, it still counts as a point for "why you should implement some things in C" because of "not directly"
Well, talent usually means innate. For me, it's the skill of being able to learn both fast and properly at the same time. I just focus on learning properly, try to not rush it.
i would choose rust for a lot of projects because it simply has better tools for abstraction and good compiler errors
the ecosystem is also pretty good at this point, and there is a sane package manager that everyone uses
there are libraries that abstract all that away for you (see: pyo3)
Make whatever you want and put it on GitHub.
Static websites are trivial to make, so I wouldn't put too much stock into it.
okay.
what do you need the id for
if you have the id of an item, and you want all the other details so you use the id to get it
non-incremental random integer IDs would do just as fine as UUIDs, i was talking about index-ish integer IDs. i suppose it works out as an ID but id rather the ID be something else and that be "rank" or such
pro tip: put the portfolio website on the portfolio website as one of your projects, thus making the portfolio website automatically populate itself
I was thinking about that.
You can also blog about creating the portfolio website, and list the blog as one of the projects
no, if you don't treat the id like a rank : ). You can do query using int just fine
recursive portfolio
What is a blog?

Nom, nom, I'm excited about web dev, I want to start soooonnnn
It's just another website, right a blog.
binary log? what does the b actually stand for
it was weblog but got shortened to blog
so the "b" is "web"
Guys, what do you think it's a good project to "graduate" from a gui framework (Pyside) and start learning something else?
we blog
still doesnt explain it /j
already done with pyside?
I can't see why you need to treat int id differently than uuid in your case. See it as a name of instance.
No, I want to make something big and more complex before jumping to my next topic
a todo app
yeah, I think a todo is a nice jump from what you just did
can forky run python newer than trixie without uv?
What's a todo?
like a task list
I can only think of "all" in Spanish lol 
Ohhh, a to-do list app?
yeah
QListWidget will be your friend
or maybe even QTreeWidget if you want to make some categories
Mhmmm, that sounds good
I could even make kind of like a project roadmap-thingy
Instead of just a to-do list, make it related to what I'm making
kanban board
Oohhh, this sounds great
but you are making a to-do list app
are you gonna make a to-do-list-app-project app? ๐
Yes :D
todo to-do
Make a game.
Hi chat
I'm thinking of a lot of functionality to add to it, this sound incredibly could in my mind
Iโm new here
not in pyside
!slorb
Here are the top free resources we recommend for people who are new to programming:
- Automate the Boring Stuff โ an online book (also available to purchase as a physical book)
- Harvardโs CS50P course โ video lectures (slides and notes provided) with exercises
- Python Programming MOOC 2026 course โ text-based lessons with exercises
- Corey Schafer's YouTube playlist
For a full, curated list of educational resources we recommend, please see our resources page!
I already made a simple game, but Pyside isn't really to make games, it's to make apps.
there's lots of simple GUI games you could make in pyside
I never heard of that one cool.
battleship, hangman, blackjack
ah, fair, minesweeper comes to mind
Oohhh, making those would also be cool
I still have a ton of projects that I can make in Pyside hehe
I've been using pyside for 6+ years and still learn new things all the time
It's a great framework
Mhmm, I think I will make my project-todo-manager app

It can be either pretty simple or insanely big
minesweeper players terrify me
I learnt how to play and it was like...

Hello.
Now I forgor
I still don't understand how to play Minesweeper.
minesweeper players are neural networks larping as humans
yea basicaly
Hi, I am new.
hi new, i am lambda
dammit
Well, the numbers mean how many bombs are adjacent to the button
hi lambda, im @ashen cipher
Let's take this discussion into the ot0?
i need to change my server display name one of these days
Hii
bro said that like it takes more than 5 seconds
/nick x
issue is i need to think of one
The best thing about having an android phone is being able to install Termux and run pretty much anything I make in my PC
suggest a name for my terminal coloring python library
vec null is peano naturals
its a library like colorama
Hello, I'm new too
not app, python library
yatcpl :^)
not really
yet another terminal coloring python library
i was thinking like pastelcolors or spectrum or vibgyor or smth like that
Oh, I need to make a TUI app some day
its my first python lib ๐ฅ
I really love TUI
poxel
zero = []
succ(n) = [*n, null]
all vec<null>s represent a given n, equal to the vec's size
i was thinking maybe even include my name ๐
variagattyd
i need an easy t oremember name ๐
well yeah, that would be more like ```rs
enum Number {
Nonzero(Box<Number>),
Zero(Vec<>)
}
Vec<Number>```
i found a really good name!!!
VIBRANT
what is the use of indexing in python
vexel
vibe rant
how has that not bene taken
letsgo :D
IKR SUCH A STEAL
That already exists actually
i still like vexel more
!pypi vexel
vibrant is more related to colors
its when you have an ordered bunch of items and want to access a specific one by its numeric order
arguable
Not a python pkg tho, it's a website
https://en.wikipedia.org/wiki/Vexel taken by a wikipedia page ๐
also what is the use for using code line in modules like variable= x
you mean "what are the double underscores on both sides for in stuff like __name__?"
___variable___= __x__
vercel?
Secret variables
that's __variable
Thats private
thats mangled
private is single _x
exactly like i came upon a topic where im learning python it used the underscored variable explaing what it shows something in module in another python code whereas some other in main code
๐ฅด
thats specifically about if __name__ == "__main__":
yes
yeah thets the exact code
in general the double underscores on both sides of a name are for names "reserved" by python
the __name__ global variable is one of those, python sets it to the name of the module. for the entry point module, which the program started running from, its the string "__main__"
so how does it help in anything in general as a function
!name
ยป if-name-main
ยป names
ยป off-topic-names
it makes sure it wont collide with names people would use for their actual variables
the assumption is that people wont normally name their things __x__, so its only used for special things
!if-name-main
This is a convention for code that should run if the file is the main file of your program:
def main():
...
if __name__ == "__main__":
main()
If the file is run directly, then the main() function will be run. If the file is imported, it will not run.
For more about why you would do this and how it works, see if __name__ == "__main__".
well that isnt very helpful
so secret variable sort of
is it just me or is #dev-contrib locked?
yeah but you just need to grab the contributors role in #roles
its spam prevention i think
o
hey
it's not really meant to be secret at all, it's just formed in a way to avoid name collisions
"theenglishcoder2026" with a russian display name ๐ญ
yea bc he codes in english
exactly
yk i like this more
Arent they called dunder methods? (Or like magic)
__name__ is not a method. yes its a dunder, double underscore (on both sides, idk what __x would be called though)
Private
its not just private though, its mangled. and this doesnt represent the fact that its, well, a double underscore
A name mangled attribute.
plus i am english
Its like,protected with the name of the class (idk about it outside tho)
mono dunder
question - is english an ethnicity, nation, country, or state
its a misunderstanding
It's not protected at all though. I use the term "internal" to indicate it's not meant for outside access. But I also use that for single leading underscores too.
thank
what to code..?
Try to solve problems from projecteuler.net
boring ngl. But again , i dont have alternative other than "mkae projects that u find interesting" anyway
"Boring",bro it took me 10 hours to do a percentage of problem 20 in C
percentage of problem 20 ? whats that
I need to find the sum of the digits from the number 100!
did you do this yet? #python-discussion message
So im working with strings and took me hours to make a simple addition function
import sys as _ัะธััะตะผะฐ
from typing import TextIO as ะขะตะบััะพะฒัะนะะฒะพะดะัะฒะพะด
ะพะฑัะตะบั = object
ัััะพะบะฐ = str
ะฑัะปะตะฒ = bool
ะะธัะตะณะพ = None
ะะตั = False
ะฟะพะปััะธัั_ะฐัััะธะฑัั = getattr
@lambda ะบะปะฐัั: ะบะปะฐัั()
class ัะธััะตะผะฐ:
ะฟัะตะฒะดะพะฝะธะผั = {"ััะฐะฝะดะฐััะฝัะน_ะฒัะฒะพะด": "stdout"}
ััะฐะฝะดะฐััะฝัะน_ะฒัะฒะพะด: ะขะตะบััะพะฒัะนะะฒะพะดะัะฒะพะด
def __getattr__(ั, ะธะผั):
return ะฟะพะปััะธัั_ะฐัััะธะฑัั(_ัะธััะตะผะฐ, ั.ะฟัะตะฒะดะพะฝะธะผั.get(ะธะผั, ะธะผั))
def ะฒัะฒะตััะธ(*ะพะฑัะตะบัั: ะพะฑัะตะบั, ัะฐะทะดะตะปะธัะตะปั: ัััะพะบะฐ = " ", ะบะพะฝะตั: ัััะพะบะฐ = "\n", ัะฐะนะป: ะขะตะบััะพะฒัะนะะฒะพะดะัะฒะพะด | ะะธัะตะณะพ = ะะธัะตะณะพ, ัะผััั: ะฑัะปะตะฒ = ะะตั) -> ะะธัะตะณะพ:
if ัะฐะนะป is ะะธัะตะณะพ: # :( cant translate keywords
ัะฐะนะป = ัะธััะตะผะฐ.ััะฐะฝะดะฐััะฝัะน_ะฒัะฒะพะด
assert ัะฐะนะป is not None # stupidass typecheckers
ัะพัะผะฐัะธัะพะฒะฐะฝะฝะฐั_ัััะพะบะฐ = ัะฐะทะดะตะปะธัะตะปั.join(ัััะพะบะฐ(ะพะฑัะตะบั) for ะพะฑัะตะบั in ะพะฑัะตะบัั) + ะบะพะฝะตั
# translating methods would suck too, would need fishhook or something
ัะฐะนะป.write(ัะพัะผะฐัะธัะพะฒะฐะฝะฝะฐั_ัััะพะบะฐ)
if ัะผััั:
ัะฐะนะป.flush()
ะฒัะฒะตััะธ("ะัะธะฒะตั, ะะธั!")
๐ญ ๐ญ
๐คท
privet
Is this GTA VI?
actual programming crime
The first thing you have to learn to program is English ๐ฅ
there's a shortcut for this isn't there? you don't actually want to count them all.
That's Half Life 3
cs3
programming war crimes
everything except the empty set
CS2 is actually turning good recently.
this implies a programming war
@ashen cipher your nickname is the universal set?
import typing as ะฟะตัะฐัะฐะตั
Is there a way to calculate only the mantissa of a big number? Because I know that 100! will have alot of useless zeros
except the empty set
Fun
ction
al
relationship
between sets
isn't that an actual syntax proposal for the initialization of python empty set

!pep 802
{/}
should've made it o/ instead so it would've looked like someone waving
should've made some pancakes
quite a few, but not too many.
93,326,215,443,944,152,681,699,238,856,266,700,490,715,968,264,381,621,468,592,963,895,217,599,993,229,915,608,941,463,976,156,518,286,253,697,920,827,223,758,251,185,210,916,864,000,000,000,000,000,000,000,000
I just hate you
thanks
dw the set of everything except the empty set i love you so it cancels out
skull
Moscow in my python code? 
{*()}, perhaps optimising to compile this to theBUILD_SETopcode
prediction: this is going to win
(in a few years)
checked the python docs now clarified thanks
its more likely than you think /j

lets just break everything, {} = empty set {:} = empty dict
Standards Track means accepted, right?
(/)
this is how it shouyld've ben
Isn't there status?
probably would have been, if sets weren't added years after dicts.
Standards Track is one of those which also includes Informative and other types
right, right
left, left
Sets has their own hash function iirc
!pep 832
hey what should i code? im at the level of file manage ment
manage ment
set.__hash__ is None
frozenset
who froze my sets
me, mario
never seen this before
i wanted to eat some warm sets
kinda cool
Disney
dis.ney? whats that
Wdym "level of file management". I didn't know we had levels. ๐ญ
idrk like learning
yea im level 7
we had levels for a bit after april 1
do you know with open(): ...? Since you said file management
6.5 +- 0.5
This is the first time I've ever heard this phrase. What a horrible thing to say.
yep
mb
Yall quickly, is this valid?
type Noneable[T] = T | None
Explain to me what it does
Learning is amazing, don't say you don't like it ๐
Yes, but not very useful
!pep 695 in versions after and including 3.12 yes
Isn't this tryna typing.Optional[T] ?
I rly just meant like "type using generic type" but easier for me to give code ngl
Isn't it the same thing
It was jst an example DW
ooh
yes
Yes, that's the right syntax for defining a generic type alias. See the PEP above and the page in the typing docs (https://typing.python.org/en/latest/spec/aliases.html)
Noice
Thx
It lets you to write directly in the file instead of print(variable, file=filename), you can do f.write("Hello World!") if you add as f at the end

and other stuff but thats what i mainly do with it
I never used it like that. Good point
So basically fprintf vs fwrite is what Iโm getting from this
Holy C
the file argument to print has to be an actual file object with a write method, not a file name
I hate C, i need namespace not prefixes
- you can do variables in f.write(), but it only takes ONE argument so you can't go:
f.write("Hello! ", "World!")
My brain is used to C yk
Is file= has to be full file protocol or is a typing.Protocol with write() method?
You could just do "Hello! " "World!"
Not like i know anything about file protocol if it exists.
just .write(str)
and if you do flush=True then also .flush()
So it's structural typing ?
yes, or really its duck typing. the stdlib itself doesnt even define it
Ooh
like
print("Hello World!", file=filename)```
That would be using it in print
with open("test.txt", "w") as f:
f.write("Sana sana colita de rana")```
?
Yeah
Aren't they the same in python or i missed something
I hate that C doesnt have a 1024 bit integer by default
Structual typing vs ducking typing
its weird to call this a filename. its not a filename, its a file.
Thats not rly a filename
"filename" isn't a file name
Thats an open file
ik but im using it as an example
Y'all count your int bits? Hold my int()
Ngl IVe never had a use for that big an int but understandable
I hate your nickname
Is it true you people gotta pass your container's length count everywhere if one wants to iterate over it? Idk C
Hatersll hate yk
Yes

Or you end it with a special value
I love OOP.
Cuz the arrays decay to pointers
Ooh like a sentinel?
haskell guy gonna have a stroke bruh
Holy physics
with open(userinput, "w") as f:
f.write("Hello World!")
Well. Sorta. Not always
or you can do "a" for it not to overwrite it
use C23, then you can use _BitInt upto BITINT_MAXWIDTH
on x86-64 gcc its 65535
Well, when you pass an array to a function it decays
Why not filename as varname this time?
XD
cuz its input from the user, also last time it was just to declare filename
Yeah, but only the "outermost layer" decays. If you have a 2d array, the inner arrays don't decay
Filename and extention implies smth like how fat stores them, basically this: NAME EXT
Isn't it more appropriate to name it filename this time? Unless you really want to differentiate or validate user_input vs final filename.
extension is (e.g) .py or .cpp
differiantiate plus its input from the user
pathlib.Path can help you in partification of given file string i guess
Like FILE PY
Then what you did was right
๐
Thats how itโs implemented in fat
Filename is 11bytes padded with spaces
Then 3 for extention
Also padded with spaces
im talking abt python
What if user inputed more than that?
this is real
No, that's irrational!
Im saying thats what your prompt implies
ints cant be irational, they are (x:int)/1
oh
Damn
and it supports arithmetic operations
no printf specifier for them though so need to mod10 loop yourself
so itโs x/1/1/1/1/1/1โฆ
guys im heading into the algorithm part of python, wish me luck ๐ฅฒ
cuz if x is of type int then x is x/1
And so on
Forever and ever
I am using ruff, what setting should I change for ruff to auto-explode when there's a trailing comma?
def func(x, y,):
...
-->
def func(
x,
y,
):
pass
Rn it removes the comma
Ints are basically a number from the integer set,because they are a subset of the rational,it can be written as n / m
Im jst playing with the syntax fam
Technically any int x can be written as n/10 as long as n = 10x btw
line-length = 1
it should do that already
https://docs.astral.sh/ruff/settings/#format_skip-magic-trailing-comma this is false by default, so not skipped
Yeah It seems like it's not ruff, maybe some other formatter running as well
with open(user_input, "w") as file:
file.write("Hello World\n"[0])
file.write("Hello World!\n"[1])
file.write("Hello World\n"[2])
file.write("Hello World\n"[3])
file.write("Hello World\n"[4])
file.write("Hello World\n"[5])
file.write("Hello World\n"[6])
file.write("Hello World\n"[7])
file.write("Hello World\n"[8])
file.write("Hello World\n"[9])
file.write("Hello World\n"[10])
I wouldn't do this but you know
Hey @pallid frigate!
Add a py after the three backticks.
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
user_input = input("Enter File.EXTENSION: ")
with open(user_input, "w") as file:
file.write("Hello World\n"[0])
file.write("Hello World!\n"[1])
file.write("Hello World\n"[2])
file.write("Hello World\n"[3])
file.write("Hello World\n"[4])
file.write("Hello World\n"[5])
file.write("Hello World\n"[6])
file.write("Hello World\n"[7])
file.write("Hello World\n"[8])
file.write("Hello World\n"[9])
file.write("Hello World\n"[10])
I wouldn't do this but you know
It seems that it first auto-fixes it, as a trailing comma is not allowed, and then formats it. But it should be other way around in vscode..
you have a space after the py
it needs to be the last thing on the line
oh
will python save the world from A.I ?
user_input = input("Enter File.EXTENSION: ")
with open(user_input, "w") as file:
file.write("Hello World\n"[0])
file.write("Hello World!\n"[1])
file.write("Hello World\n"[2])
file.write("Hello World\n"[3])
file.write("Hello World\n"[4])
file.write("Hello World\n"[5])
file.write("Hello World\n"[6])
file.write("Hello World\n"[7])
file.write("Hello World\n"[8])
file.write("Hello World\n"[9])
file.write("Hello World\n"[10])
I wouldn't do this but you know
maybe
should post this a few more times in case we didn't see it yet
working on python thing
the interpreter seeing you write car by car ::
the kernel doing the write syscalls car by car ::
๐ญ ๐ญ ๐ ๐ฅ
you can just edit the original msg bro
car by car?
chairacter
actor based language is really just string based language
user_input = input("Enter File.EXTENSION: ")
with open(user_input, "w") as file:
x = 0
while x < 20:
file.write("hello worldaaaaaaaaaaaaaaaaaaaaa\n"[x])
x += 1
Use a loop

dry: do repeat yourself
LMAO
nah
Sometimes repeating yourself is the best choice
Yeah two similar functions with a different key detail can be cleaner than some big abstraction to handle both cases
I love how writing the 1st 20 chars of a string is less loc in C than Python
Or u jst use some annoying string slicing
sometimes sed is the solution
This is the code btw ```c
(void) printf("Enter filename: ");
char user_input[1024];
(void) scanf("%s", user_input);
FILE* file = fopen(user_input, "w");
fwrite("hello worldaaaaaaaaaaaaaaaaaaaaaa\n, 20, sizeof(char), file);
"annoying"
String slicing is kinda annoying imo
that's a funny joke
i dont think thats a valid usage of scanf
this also doesnt check for errors, and doesnt close the file
Fk, im stupid
My brain is cooked rn
also syntax error
eh, thats obvious, no need to mention it
scanf("%s"); seeing this gives me chills
Itโs a segfault waiting to happen
lol
its a compile error waiting to happen, assigning it to char* that is
and yeah reading an arbitrary sized string is not a good idea
Ignore the warnings and itโll have 3 segfaultable locations
i love writting C and my code doesnt work on one compiler but works on the other
very cool
dont write bad code
you probally wrote some really weird C then
or used some compiler extensions, or non standard C stuff
My brain is kinda fried rn ngl
can forky install python newer than trixie without uv?
maybe its alloca
im usually not this bad when it comes to writing C
best to ask the C questions in C server instead of python discussion xd
im going to get cooked
why ?
we all write bad C sometimes DW
Like this: #python-discussion message
forky and trixie being the debian releases?
yep
I see 2 segfaults waiting to happen
you dont need uv on any platform to install python versions. its just one of the version managers
you could like, compile from source
is there any difference b/w typing.NamedTuple and @dataclass with frozen=True?
a namedtuple is a tuple, a dataclass isnt. so a namedtuple can be like, unpacked, or passed to something which checks for isinstance(_, tuple)
in terms of memory usage : each tuple instance has to store the amount of fields, the instance of a (slotted) dataclass doesnt
both are "immutable" in the same way: cant reassign what the fields point to, but if the fields are mutable - can be mutated
(though bypassing this is easier for frozen dataclasses, just object.__setattr__)
anyway, apt can only install a relatively old version python in trixie
yes. a named tuple is much more lightweight. but dataclasses has more functionality
add slots=True to the dataclass (should be the default tbh) and now the dataclass is 1 size_t smaller than the tuple
i was thinking that but i use dataclasses everywhere in the code, i was wondering if its bad for consistency
how's the tuple is more lightweight if it has more 1 size_t?
the tuple is only more lightweight if the dataclass doesnt use slots
You can use both. Use whatever fits your needs.
Using dataclasses everywhere "just because" can actually slow your program by a lot (for big applications)
i wonder if you can propose a program where either of the options is significantly slower/faster, or uses significantly more/less memory
I don't see how dataclasses can be faster
yea it was alloca
alloca 
it doesnt really make sense to measure speed here, its nanoseconds for access in all cases. memory - sure, and there is an objective answer: an instance of a class with slots is smaller by atleast 1 size_t than an equivalent tuple because it doesnt need to store its size
do dataclasses have slots?
with @dataclass(slots=True), yes
ah
actually, dataclass might take up less memory
really? how?
Hi all
iirc tuples don't overallocate
where did i hear something about slots not mattering as much from 3.11 onwards
dataclasses are just code generators, you can define slots, ordering, frozen (and many more), dataclasses are great when you have a class that you'd want to implement those things for you anyway, or when there's a need for that class instance to be converted to tuples/dicts
!e
from typing import NamedTuple
from dataclasses import dataclass
import sys
@dataclass(slots=True, frozen=True)
class DcPoint:
x: int
y: int
class NtPoint(NamedTuple):
x: int
y: int
print(sys.getsizeof(DcPoint(420, 69)))
print(sys.getsizeof(NtPoint(420, 69)))
print(sys.getsizeof((420, 69)))
:white_check_mark: Your 3.14 eval job has completed with return code 0.
001 | 48
002 | 64
003 | 64
ah
imo using dataclasses like you'd use namedtuples or SimpleNamespace is an overkill
so just what we said, slots
oh, october is the month the python versions die
rip 3.10... 10 being october... fitting..
october is where pythons go to die
...wait what
wake me up when october ends
i cant believe 3.11 will be the lowest living version soon... to me it still feels like it just came out..
you know what's gonna happen in four days?
may be
in my head 3.6 just came out with fstrings
i think python was 3.6 when i started using it
or 3.7
i was inspired by this person in my scratch.mit.edu class who was making games with pygame
I remember when I had to use 3.4 ๐ and when I used 3.10 for some stuff 3.10 as current newest. Damn
https://github.com/python/cpython/pull/28802
but slots are still a non-zero improvement
Feel old yet? 2015 was 20 years ago.
nice one
noice
๐
for some reason uv defaults to 3.10
1% faster
Hello
I love that you make me feel even older than I really am...
I was under the impression slots are for memory, not speed
Why not both?
๐
definitely both, you avoid the key lookup in teh dict
true
Hello, I'm sorry but am I allowed to send an OPTIONAL to join discord server message?
I'll wait for a staffs response
you can't post any guild invites that aren't in our allowlist, if that's whata you're asking.
guild invites that aren't allowlisted will be instantly deleted.
Why emphasize the "OPTIONAL to join"? All server invites are inherently optional
discord.gg/python is actually mandatory
It's like a double barrier but good thinking
Guys i need help
well, don't bury the lead.
If you want can I give you some insights about the server so you can decide further? Because I personally feel like it would be worth it
It's up to you here
you can send a message to @pseudo carbon about it.
The EPA might want to have a word, elsewise.
yeah its not supposed to be about speed, its a memory usage optimization
though all performance related changes do speed benchmarks too
def lex(lexemes: Iterable[str]) -> Generator[Token]:
end_of_options = False
for lexeme in lexemes:
if not end_of_options:
if lexeme == END_OF_OPTIONS:
end_of_options = True
continue
if lexeme.startswith(OptionPrefix.LONG):
yield _lex_long_option(lexeme)
continue
elif lexeme.startswith(OptionPrefix.SHORT):
yield _lex_short_option_or_group(lexeme)
continue
yield ArgumentToken(lexeme)
I know what subclasses of the Token class (base dataclass) will be yielded.
And for type checkers, it's hard for them to know what subclasses of Token are available. Hence, matching subclasses of Token exhaustively will require including the base Token class itself which is unnecessary and vague.
I have a type LexerToken = OptionToken | blah blah, should i type annotate the YieldType as LexerToken rather than generic?
I have always yielded a generic type (indoctrination and now sudden change makes me feel concerned) until the day i found that it's hard for the type system to know without sealing types (which isn't present in python currently).
So do I yield by LexerToken or do i not (go generic Token)?
Or is there something else that i am not aware of that is perhaps more appropriate over these two options?

I just did, thank you
"lede"
they just deicded to spell it that way so it's not the same as Pb.
I know ๐
their workplace has a lot of Pb and things named for Pb
Pb&J.
Hmmm... So this kind of thing is called as casual-chatting? where you don't stay efficient by putting the help question directly with your 'i need help', which is a tradeoff for casual chatting? And lots of people on internet are casual in chatting which is why they don't put help question in same message and sometimes rather wait for someone to attend for helping them
hmm good discovery
class Token: ...
class OptionToken(Token): ...
class SomeOtherToken(Token): ...
def f() -> Token:
return OptionToken() if random.choice([False, True]) else SomeOtherToken()
#
def g():
t1 = f() # just some abstract Token
if isinstance(t1, OptionToken): # t1: OptionToken in this branch
...
else: # even though in practice this will always be `SomeOtherToken`, the `Token` type does not tell us that
...
# (OptionToken | SomeOtherToken) would provide this information though, so in the `else` `t1: SomeOtherToken`
thats the main difference
What is Pb and J
peanut butter and jelly
Loll

so if you can specify the exact union of types rather than just the base class, it simply provides a bit more information. some programs will need to do less narrowing
its not a big deal
After I eat, I'll code. Maybe I should make blackjack
What do I do in a for loop to format a list nicely?
Classic programming assignment. Also one I've never done lmao.
for string in colors? is string valid
you can have any assignment target (an assignment target is something that can appear on the lhs of an assignment, e.g. variable name) after for
string is a valid assignment target, as in, you can do string = something, so yes
though usually if you have colors, you'd call the singular variable color
Maybe I should make blackjack
doin that rn haha
so for string in color: is good?
Oohhh, how much have you done so far?
I have to investigate about the Blackjack rules
its valid. whether its good depends on what is color
I wanted to get familiar with the random module but ended up just using some tut code and improvising from that, kind of like a mini gam,bling
t1 knows is OptionToken | SomeOtherToken ?

How come else knows its SomeOtherToken since t1 is a base Token? 
color is a list of 6 different strings
Check out our latest Pb&J snack. Indulgent and sweet, it boasts life-shortening and intelligence-reducing properties while being quite heavy in the hand!
it doesnt
Ooh
I just don't get what I can use in for foobar in color
like number works
but it doesn't give me a list of stuff i can use
the thing after for is what the values from the iterable will be assigned to, so you're inventing a new name, not using an existing one
same as x = 1 just makes a new variable x out of nothing, for x in something: will be assigning the values from something to x one by one and running the inside of the for loop
why do u edit so much lol
idk, its a habit
i dont like writing the message out fully before sending it
so instead i write a bit, and then iteratively edit
I do
So i guess its better to Explicitly type annotate a Union of what we would return in f() , right?
it feels more like human talk
it provides more information, whether that is enough to be better is questionable
Very git-esque
does anyone know how i can include homebrew packages in a bundled app using pyinstaller?
Yeah true
numbers = [1, 2, 3]
for number in numbers:
...
for i in numbers:
...```
They're the same.
i can't find any answer onliลne
OHHHHHH
yeah
Bruh that's crazy
with a union of specific types, if you then add yield SomeNewTokenType() in the function, you'd need to change the signature
if you annotate it as simply Token - you dont, it will work for all token types
a programming rule : don't take names serious
so i can put for skibiditoiletgang in colors
mostly. i is generally used as an index variable, so it could be confusing in the second usecase there
lmao got it
That is what helpful for typecheckers, so i think its appropriate to yield LexerToken

It's pretty useful. But you can name anything anything
I just wanted to demonstrate that the name doesn't matter
Riiiiight thanks guys
Well, it does, but in this case you assign whatever name you want.
which is why I replied with "sometimes the name matters" ๐
๐
for i, number in enumerate(numbers):
...
but don't take it too unserious after learning (atleast to make other peoples and possibly your life easier)
Glad to help. :D
Tho i would need to maintain the LexerToken union, but i maintain all the tokens so i guess these not a bad thing... 
Oh mine kidna steered into the direction of like case opening
My standard is this: Descriptive and concise.
Don't understand what you're referring to... CS case opening
...?
VASS GOLD GOLD GOLD GOLD
I do not see any other third option either. Ima lock in yield LexerToken union
๐ญ ohnepixel
Okay I thought it had to be a data type or something
Bless this guy ๐
The idea being the enhancement of legibility.
100k in skins, -100k in skill.
don't have to worry about naming variables if you write pointfree...
They can be made out of cellulose, now.
him telling its fine and gagging in the end
i guess
Funny exercise I like is re-creating built-in methods, functions and other stuff
Yeah I'll name it something appropriate
That's a pretty valid exercise.
CS2 yuh
I've spent 1600โฌ on that
i: int = 0
while (i < len(numbers)):
...
i += 1
Sure, but mine gives extra redundancy.
So in case i fails, you still got number.
more LOC == more productivity
Holy God
I spent the 15$ of Prime and that's it
why the self-evident type hint and the () for the while?
Yeah I love gambling and I have disposable 'income'
i = 0
iterator = iter(numbers)
while True:
try:
next(iterator)
except StopIteration:
break
...
i += 1
del iterator
are there active vcs in this server
Python will never be statically typed, but each release seems to have more support for type annotations.
I need some of that disposable income, because I dislike gambling, I would do amazing stuff with it... Home labbing would go brrrr.
i like static type
its fun to tell the types of variables
they should just
do it man its getting hella confusing now
5 days ago I won a 320โฌ AK47 - B The Monster
0.13%
Oh my god.
fine
dynamic typing is incredibly baked in to the language. switching to static typing would be creating a new language, basically.
I love gambling because It's fun, It's a waste of money if you don't enjoy it tho
I mean, other languages do exist. You don't have to confine yourself to just one.
right in front of my salad?
In addition to changing the language, the existing type annotation system and type checkers would have to be completely scrapped too
(as they should be tbh)
I'm working on a gradually typed language like python that becomes more efficient with additional typing.
if hypothetically it did happen, what would happen to all the packages and the community?
99.9% of popular libraries will stop working and will have to be rewritten
the python community probably wouldn't adopt that new language, and it wouldn't have a package ecoystem unless a lot of people basically started from scratch to create it.
Im deep in python tutorial hell icant get out help aaaghhhh
Imo "don't have to" should be replaced with "shouldn't"
python is easy. programming is hard. be glad you're not learning programming using a harder language. ๐
when you get stuck ask questions. ๐
i: int = 0
iterator: Iterator[int] = iter(numbers)
while (1):
opcode: int = next(iterator,-1)
if opcode == -1:
break
...
i += 1
del iterator
How would it work?
you should warp your brain with other languages like Haskell, Prolog, etc.
the way it works in actually gradually typed languages like C#
why is that? ik its a crazy thing to think but couldnt there be a way, where python becomes static and then all the developers just have to go and add type annotation to the exsiting dynamic code
Iโm not remember how it work :(
and then anger the community when you use weird ideas in the python community you brought from those communities.
numbers famously never include -1
you can like verbose type annotations, but I don't get the parentheses around loop statements.
i like C
generally when fundamental changes of that scope are introduced it just becomes a new language.
add them in if then too
Reform vs Revolution. Either it would take forever, or it would be a different language
im ngl, i really really enjoyed my time learning java for college because how concerete that language felt. im thinking if i should persure this path or not haha
And even then, 3.14 is a different language from 3.15
Java's not my favorite language. But at least it makes Kotlin easy to pick up. ๐
Is there a version of Python thatโs green
ohh theres so many kotlin developers in india i think
Like itโs a bright green coloured Python rather than a blue and yellow Python
all the developers just have to go and add type annotation to the existing dynamic code
It's not how programming works. It's not like Python users are children and Python core devs are their parents who can tell them what to do.
If Python 3.X+1 introduces a change that means manually changing millions of lines of people's code, Python users will just stick to Python 3.X, and they will stop financially supporting the Python Software Foundation because it clearly went off the rails.
the perl 6 incident
Python's type annotations are not foolproof, they have a lot of "holes". It's not like Java or C or C++. Any would be an example of such hole: ```py
def f(x: Any) -> None:
x.foo().bar() # type checks fine
f("banana") # also type checks fine
one of the ways devs can go is to choose a linting tool that checks type annotations, and to set it for maximum strictness, so that any code without consistent annotations gets flagged. but that's entirely opt-in and is not enforced at runtime.
I'm not sure Java, C, or C++ are sound. I thought things like null ruin soundness iirc.
(insert Rust my beloved)
maybe C and C++ were a bad example, with how easily you can screw things up
nah it's all good. I get what you mean. I'm just trying to help if you get some type theorist that says "Well acsuallly..."
I probably wouldn't use the word soundness myself, that's just the name of the repo (:
For instance, if you write this function in Rust: rs fn banana(x: u32) { } there's no way to make it so that x is a string. It wouldn't even make sense in the universe of Rust, and banana won't accidentally use string methods on x even if you do screw this up in some major way
(well, there are some bugs in rust that sometimes lead to unsoundness iirc)
Tbh Kotlin resolved most of Java issues with its stuff like String vs String?, but it still has issues with Java interlop types and unchecked casts
mostly lifetime related
yeah
I'm really unsound personally. I'm just used to it by now.
to me everything is just a set. ZFC supremacy.
im trying to use the coalton mine IDE but it has no vim motions so im dying
its interesting that they tried to make an IDE
why are you forsaking the goated editor?
i made my first ever python tool today
i would be an emacs user if i learned about emacs before i learned about vim
Honestly, I just need my editor to have easymotion variant for it then I'll use it.
It's also about tradeoffs. For example, this is a narrowing that type checkers support: ```py
class X:
prop: object
def foo(x: X) -> None:
reveal_type(x.prop) # object
if isinstance(x.prop, int):
reveal_type(x.prop) # int
``` this is clearly wrong because x.prop could change after it's checked (or it could be a @property, in which case this narrowing still works). But prohibiting this was decided to cause too much inconvenience
Being able to do:
>>> x = 3
>>> x
3
>>> x = "happy"
>>> x
'happy'
Is actually wild. I'm working on a compiled python like language, and getting this functionality is surprisingly annoying.
why would you ever do that?
do you want to support that?
I like this feature in Rust, but I would also understand if the language doesn't want to support it
I'm trying to keep the language as fun as possible. So my plan is: if there is no type then you can. if there is a specified type then you can't.
a compiled language would usually separate assignment from declaration
then this is easy to implement
Is it statically or dynamically typed?
I'm aiming for gradually typed.
I originally tried re-implementing python, but there were too many issues. So, now it's mostly python like, gradually typed.
Why gradual typing for a new language?
The idea is prototype fast, optimize later.
I want something that you can quickly spitball ideas like Python, but if you want to sit down and type it later, it ends up being pretty fast too.
I mean, maybe it sounds stupid.
but I kind of want it at least personally
I think the thing that would be popular today or in 10 years is less in the direction of lawlessness, but rather a statically typed language that introduces types in a very non-bureaucratic way. Things like: type inference everywhere, structural records/tuples
@main swan this was an idea I explored myself - anything untyped would be an "object" type that would require a specific runtime, anything typed would be native code. You could declare a "strict" mode so that the program would not compile if any "object" types remained. Didn't get very far as I was simply not good at language or compiler design
Well, if you get interested again, we can team up maybe? I have a repo for the language and stuff.
(but I'm also not a language designer)
bro described roc
yeah, something like that
I have way too much else to do :D I'm leaving all this to people far more dedicated and knowledgeable about the field than I am
just use common lisp
I have no idea about language design lol. I need someone to guide me too haha. But alright. no worries. ๐
i've also been getting side tracked by other smaller projects i'm working on. but we'll get there eventually (I think?)
-# ๐ชฆ๐ฅ
The language does sound interesting though.
Alright. I'll keep working on it then! ๐ (I think I've just been having esteem issues recently. My website idea I implemented was torn to shreds by the math community lol)
Ooh, it does look interesting indeed.
unfortunately you won't be able to write it on paper
what happened to your website idea (and what was it?)
There are so many cool languages that I get curious about and then see that they're dead, too new to really enjoy playing with, or in just some sort of limbo.
Or you get that "Eh... why learn something new when it's not going to go anywhere" moment
real
RIP Elm
My interest in languages as such wanes the more I find I want to work on some specific project, because 99.99% of the time I can do what I want with Python, C (via Cython), or one of the other top few languages out there.
It was an apparently very spicy math site similar-ish to Project Euler: Read some of the Reddit comments about it
And that says at least as much about my needs and interests as it does any of those languages as such
This. I was SO stoked for Elm to be more than it ended up being
I just have this habit of wanting to try new things for the sake of learning them. I think that's mainly because I do it as a hobby, so it doesn't matter a whole lot if it's useful.
But the moment I see that a language doesn't have string interpolation, I nope out of there
I think they had a valid point: how do you calculate the closeness of a solution to a problem that doesn't have one yet?
imagine learning about dependent types to end up writing dynamically typed slop
Hi there, I wish you all having a great day
It's mostly for fun: but the point is that you can frame each problem as an optimization problem.
the fact that even 1 new language became so used (rust) is already insane tbh
I mean, if you want to build it for fun, build it
It exists. (I have built it and apparently lost all my credibility in the math field)
tbh, I can live without string interpolation (if it buys the language something else)
as I do so much work with text, I cannot
hey can anyone help me with vs code theme change i tried but it won't work even though i have uninstalled extension
one post that garnered some negative reactions equates to total, permanent, irrevocable loss of credibility?
I have had some irl interactions that have also been unsavory once mentioning that I made the website lol. But screw em anyway, i'm gonna keep working on it (but I have some other more immediate stuff to do atm)
speaking of rust, I don't get why uv can't resume a download
If you'd like some feedback, I think it would be better received if you answered some of the obvious questions up front when posting/talking about it.
Something like how you define closeness would be good to know upfront when first hearing about the project, since that is the obvious question. It shows you've put thought into it and how you're approaching things.
Also referencing its closest analogs so people can have a good comparison point.
I think it's a fun project and some adjustments on how it's communicated could make it be received better
I think I did tho unless I'm misunderstanding. my comment got downvoted to oblivion (check below the top comment)
My point is that it's not in your post. Someone had to ask and then you responded. That's not being upfront
Alright. I see what you are saying.
It would also help to answer some of this stuff in the repo README as well.
For better or for worse, how something is communicated can have a large impact on how people judge the underlying idea
what can it "buy"?
true
well, lesson learned. Unfortunately, I can't really re-post back there again. I will update the README soon.
Idk, simplicity? For example, Elm doesn't have traits.
I mean, it's reddit. Sure you can just give it a few months and with some improvements
okay yeah that makes a bit of sense (though elm has stuff like comparable)
yeah that's a bit undercooked
if a language has some form of implementing a generic operation for a given type then fstrings seem simple
Well, you could have interpolation that only supports strings, like "Hello, ${name}!". But it'd be kinda undercooked too.
you'd end up with ${x.show()} everywhere
That is also an option. Though Rust doesn't have this, only allowing simple expressions like variable names and attribute accesses in interpolated strings
(but it does have Display and Debug)
So you sometimes end up having to go back to println!("foo {0} bar {1} baz {2}", expr1, expr2, expr3); anyway
Hello
vibrant is reserved by pypi
i thought i found a cool name for my project and it throws an error
what error?
Uploading vibrant-0.1.0-py3-none-any.whl
100% โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ 12.5/12.5 kB โข 00:00 โข ?
INFO Response from https://upload.pypi.org/legacy/:
400 Bad Request
INFO <html>
<head>
<title>400 The name 'vibrant' isn't allowed. See
https://pypi.org/help/#project-name for more information.</title>
</head>
<body>
<h1>400 The name 'vibrant' isn't allowed. See
https://pypi.org/help/#project-name for more information.</h1>
The server could not comply with the request since it is either
malformed or otherwise incorrect.<br/><br/>
The name 'vibrant' isn't allowed. See
https://pypi.org/help/#project-name for more information.
</body>
</html>
ERROR HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
Bad Request
maybe it's automated typosquatting protection
yeah
vibrance is a package that exist
vibrance? that isnt as good as vibrant though
i've decided to go with vibrantcli
what does it do? Are you going to support it into the future?
or could u suggest some other good names?
I meant that vibrance is a thing that already exists on PyPI. So maybe PyPI automatically disallows taking a similar name.
I could be completely wrong though, I don't know the details of how anti-typosquatting works onPyPI
no its a hobby project. Its something like colorama. colorful ansi text. it does have suport for windows cmd which only a few color text providers give
vibransi
colors_are_cool
too long isnt it
Does it need to be on PyPI?
if i do pip install <lib> it installs from pypi right
did you go to the urL?
real
just install with git from some repo hosting
The project name is too similar to an existing project and may be confusable.
oh_hey_is_this_a_color_library_that_is_dope
yes
i want to have one package of my own on pypi ๐ฅบ
You can also install things from a git repo https://stackoverflow.com/questions/20101834/pip-install-from-git-repo-branch
then I'm not sure where the confusion is
The name vibrant conflicts with a popular JS project: https://github.com/Vibrant-Colors/node-vibrant
kk
sincerely, unless it's something useful that you intend to actually support in good faith goin gfowrard, don't.
can you all suggest some good names?
everyone does that
sure il work on it a lot but theres only finite things that could be done here in this project
how about vibgyor?
chatgpt could actually be good for this
im ngl, just package rather than author/package is making me sad
a_super_duper_colour_lib
chromapy?
You must be Veltrix? Do you use Python for your websites? I heard that you make websites from B3ttaFish
you are bettafish stop the bluff
they are clearly alphafish, not beta
display names never lie. they cant be set to arbitrary things
how does this library differ from other libraries that help with terminal coloring?
I guess you could do author-package, but yeah, namespaces of that kind would be nice.
GitHub freaking out
I have work to do ๐
mine supports windows cmd ansi coloring like colorama and has rgb + hex support which colorama doesnt have. and its really easy to use
what happened
It's telling you to take a break.
Jesus christ, all the ones I'm looking for are already taken or are being name squatted
When I tried to use Github earlier today it gave me some weird error message and saying that I can't upload my file.
I think receiving 7 NDRs saying my now 44mb email chain is too big should have been my first cue
rainbowcli?
yeps
but your library is not a cli
its a library
name it rainbowgui
you should
(thus the urging to not release to pypi)
its certainly not a gui
well it's not CLI either
There is a process to request that a name squatted PyPI name be handed over to you. No guarantees, but it's possible
It sure does take a while
ok wait il think some more
name it veltrix-ansi-lib and be done with it
I just remember that I have an almost-empty PyPI package I used for testing purposes. Hopefully PyPI doesn't kill me
but the name is unlikely to be contested
Yeah, namespacing by putting your name sounds like a good move, if you want the project on PyPI
kk
Name it Gilbert.
il brainstorm a few more names and if i cant find a good one, il use my name
bro
How did you know my name?
@inner adder managed to find any?
Still thinking
What, that''s Gilbert's name. My profile picture's name
I'm usually good at naming things but so many are already taken
ikr me too
Gilbert-The Defecttive Fish.
Yeah -- all of my projects have my org name on them, $DAYJOB or otherwise
Gilbert's name is Gilbert
rainbow-terminal?
They can see a significantly larger number of colors than other animals
And they're really colorful as well
how is that even remotely related to my project ๐
Is it common practice to make different repositories for different files?
of all the animals in the world...
You can name it Sparrow, since they also can vibrant colors
We give colors to SHRIMP!?
What would you call a recipe book app (I'm trying to come up with some some names)
ima name it rainbow-terminal. sounds cool too
what do you really mean
a repository is supposed to be for a project. a project can include many files
Look at this colorful little bastard
Like 1 repo for 1 .py file and etc
smh image perms abuse
lowkey a good idea
many ppl wont know this colorful little bastard
Name it Manti
mantis shrimps also can see a lot of color
mantI
They will if you make it the logo for the package
you're a good idea
mantis-colors
thanks
What is this for?