[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Pythonistas will defend this

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 23
Thread images: 8

File: 1475079864580.jpg (101KB, 1024x904px) Image search: [Google]
1475079864580.jpg
101KB, 1024x904px
>>> "⅐ↁⅣⅧↂⅪ".isnumeric()
True
>>> "ⅬⅭⅮ⅟Ⅿ39ↀ".isnumeric()
True
>>> "-3".isnumeric()
False
>>
File: b19810_5576352.jpg (27KB, 517x326px) Image search: [Google]
b19810_5576352.jpg
27KB, 517x326px
>>> flatten([[1, (2, 3)]])
[1, 2, 3]
>>> flatten('hi')
RecursionError
>>
>>61766673
It's precisely defined in the docs.
> Return true if all characters in the string are numeric characters, and there is at least one character, false otherwise. Numeric characters include digit characters, and all characters that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the property value Numeric_Type=Digit, Numeric_Type=Decimal or Numeric_Type=Numeric.
>>
File: mfw.png (208KB, 720x640px) Image search: [Google]
mfw.png
208KB, 720x640px
>>> (0, 'a') < (1, 0)
True
>>> (1, 'a') < (1, 0)
TypeError
>>
File: 1445804688594.jpg (85KB, 454x453px) Image search: [Google]
1445804688594.jpg
85KB, 454x453px
>>> x, y = 999, 999
>>> x is y
True
>>> x = 999
>>> y = 999
>>> x is y
False
>>
File: 1492028058663.jpg (20KB, 306x306px) Image search: [Google]
1492028058663.jpg
20KB, 306x306px
>>> map = {True: 'yes', 1: 'no', 1.0: 'maybe'}
>>> map
{True: 'maybe'}
>>
>>61766881
>What is a hashing function?
>>
>>61766814
I would guess that this behaviour is specific to CPython implementations, since it preallocates a small range of integers and 999 falls outside of it.
>>
>>61766996
Do you know what "is" actually does?
>>
>>61767057
do you?
>>
>>61767073
Maybe?
>>
File: 010 - OPh5S.jpg (62KB, 473x635px) Image search: [Google]
010 - OPh5S.jpg
62KB, 473x635px
>>61767083
good for you, friend.
>>
File: file.png (49KB, 887x943px) Image search: [Google]
file.png
49KB, 887x943px
>>61767105
>>
i've been programming in python for literally years and never ran into any of these issues. if you aren't an autist looking for edge cases, you will never have any problems with it

the difference between c/c++ and python is that the retarded shit in the former happened much more often, in no small part due to more problematic edge cases existing
>>
>>61766673
re.match('\d+')
>>
>pythonistas
never use this word again
>>
>>61769850
Python Artisans
>>
is and == are not the same thing tards.
>>
>>61766814
Only in REPL
>>
File: 1497135536456.png (351KB, 512x512px) Image search: [Google]
1497135536456.png
351KB, 512x512px
>From PEP 8
>Spaces are the preferred indentation method.
>Python 3 disallows mixing the use of tabs and spaces for indentation.
>Python 2 code indented with a mixture of tabs and spaces should be converted to using spaces exclusively.
>Avoid trailing whitespace anywhere. Because it's usually invisible, it can be confusing: e.g. a backslash followed by a space and a newline does not count as a line continuation marker.

>This is literally an encouraged styling
if (this_is_one_thing and
that_is_another_thing):
do_something()



>B-B-BUT WHITESPACE SYNTAX FORCES YOU TO MAKE IT READABLE!
That's what a linting tool is for you fucking cucks
>>
>>61771585
>That's what a linting tool is for you fucking cucks
Using lint is for cucks

Real men get it right the first time.
>>
>>61767235
Explain this what is identity comparing? space in memory?
>>
>>61772534
is just checks to see if two objects are the exact same object.

The builtin id() returns a "unique identifier for an object"; in cpython, this is implemented as "return the object's memory address".
Thread posts: 23
Thread images: 8


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.